comparison src/parse.y @ 4244:189df16144fc

[project @ 2002-12-28 02:00:05 by jwe]
author jwe
date Sat, 28 Dec 2002 02:00:05 +0000
parents 7e4d5b5520e5
children 610671be8792
comparison
equal deleted inserted replaced
4243:7e4d5b5520e5 4244:189df16144fc
3374 { 3374 {
3375 bool script_file_executed = false; 3375 bool script_file_executed = false;
3376 3376
3377 std::string nm = sym_rec->name (); 3377 std::string nm = sym_rec->name ();
3378 3378
3379 static string_vector names (2); 3379 string_vector names (2);
3380 3380
3381 names[0] = nm + ".oct"; 3381 names[0] = nm + ".oct";
3382 names[1] = nm + ".m"; 3382 names[1] = nm + ".m";
3383 3383
3384 std::string file 3384 std::string file
3385 = octave_env::make_absolute (Vload_path_dir_path.find_first_of (names), 3385 = octave_env::make_absolute (Vload_path_dir_path.find_first_of (names),
3386 octave_env::getcwd ()); 3386 octave_env::getcwd ());
3387 3387
3388 int len = file.length (); 3388 int len = file.length ();
3389 3389
3390 if (file.substr (len-4, len-1) == ".oct") 3390 if (len > 4 && file.substr (len-4, len-1) == ".oct")
3391 { 3391 {
3392 if (octave_dynamic_loader::load (nm, file)) 3392 if (octave_dynamic_loader::load (nm, file))
3393 force_link_to_function (nm); 3393 force_link_to_function (nm);
3394 } 3394 }
3395 else 3395 else if (len > 2)
3396 { 3396 {
3397 // These are needed by yyparse. 3397 // These are needed by yyparse.
3398 3398
3399 unwind_protect::begin_frame ("load_fcn_from_file"); 3399 unwind_protect::begin_frame ("load_fcn_from_file");
3400 3400
3402 unwind_protect_str (curr_fcn_file_full_name); 3402 unwind_protect_str (curr_fcn_file_full_name);
3403 3403
3404 curr_fcn_file_name = nm; 3404 curr_fcn_file_name = nm;
3405 curr_fcn_file_full_name = file; 3405 curr_fcn_file_full_name = file;
3406 3406
3407 if (file.length () > 0) 3407 script_file_executed = parse_fcn_file (file, exec_script);
3408 script_file_executed = parse_fcn_file (file, exec_script);
3409 3408
3410 if (! (error_state || script_file_executed)) 3409 if (! (error_state || script_file_executed))
3411 force_link_to_function (nm); 3410 force_link_to_function (nm);
3412 3411
3413 unwind_protect::run_frame ("load_fcn_from_file"); 3412 unwind_protect::run_frame ("load_fcn_from_file");