comparison src/variables.cc @ 9144:c6463412aebb

eliminate symbol_table::scope_stack; fix scoping issue with evalin
author John W. Eaton <jwe@octave.org>
date Tue, 21 Apr 2009 15:39:57 -0400
parents 4cb9f994dcec
children 5579998f8acf
comparison
equal deleted inserted replaced
9143:74d5c1a4ca96 9144:c6463412aebb
1379 error ("whos: -file argument must be followed by a file name"); 1379 error ("whos: -file argument must be followed by a file name");
1380 else 1380 else
1381 { 1381 {
1382 std::string nm = argv [i + 1]; 1382 std::string nm = argv [i + 1];
1383 1383
1384 unwind_protect::begin_frame ("do_who_file");
1385
1386 // Set up temporary scope.
1387
1384 symbol_table::scope_id tmp_scope = symbol_table::alloc_scope (); 1388 symbol_table::scope_id tmp_scope = symbol_table::alloc_scope ();
1385 1389 unwind_protect::add (symbol_table::erase_scope, &tmp_scope);
1386 unwind_protect::begin_frame ("do_who_file"); 1390
1387 1391 symbol_table::set_scope (tmp_scope);
1388 symbol_table::push_scope (tmp_scope); 1392
1389 symbol_table::push_context (); 1393 octave_call_stack::push (tmp_scope, 0);
1390 octave_call_stack::push (0);
1391
1392 unwind_protect::add (octave_call_stack::unwind_pop, 0); 1394 unwind_protect::add (octave_call_stack::unwind_pop, 0);
1393 1395
1394 unwind_protect::add (symbol_table::clear_variables); 1396 unwind_protect::add (symbol_table::clear_variables);
1395 1397
1396 feval ("load", octave_value (nm), 0); 1398 feval ("load", octave_value (nm), 0);
1402 1404
1403 retval = do_who (i, argv, return_list, verbose, newmsg); 1405 retval = do_who (i, argv, return_list, verbose, newmsg);
1404 } 1406 }
1405 1407
1406 unwind_protect::run_frame ("do_who_file"); 1408 unwind_protect::run_frame ("do_who_file");
1407
1408 symbol_table::erase_scope (tmp_scope);
1409 } 1409 }
1410 1410
1411 return retval; 1411 return retval;
1412 } 1412 }
1413 else if (argv[i] == "-regexp") 1413 else if (argv[i] == "-regexp")