Mercurial > octave-nkf
comparison src/pt-cmd.cc @ 8658:73c4516fae10
New evaluator and debugger derived from tree-walker class
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 04 Feb 2009 00:47:53 -0500 |
parents | 4976f66d469b |
children | 35cd375d4bb3 |
comparison
equal
deleted
inserted
replaced
8657:102e05821f93 | 8658:73c4516fae10 |
---|---|
43 tw.visit_no_op_command (*this); | 43 tw.visit_no_op_command (*this); |
44 } | 44 } |
45 | 45 |
46 // Function definition. | 46 // Function definition. |
47 | 47 |
48 void | |
49 tree_function_def::eval (void) | |
50 { | |
51 octave_function *f = function (); | |
52 | |
53 if (f) | |
54 { | |
55 std::string nm = f->name (); | |
56 | |
57 symbol_table::install_cmdline_function (nm, fcn); | |
58 | |
59 // Make sure that any variable with the same name as the new | |
60 // function is cleared. | |
61 | |
62 symbol_table::varref (nm) = octave_value (); | |
63 } | |
64 } | |
65 | |
66 tree_command * | 48 tree_command * |
67 tree_function_def::dup (symbol_table::scope_id, | 49 tree_function_def::dup (symbol_table::scope_id, |
68 symbol_table::context_id /*context*/) | 50 symbol_table::context_id /*context*/) |
69 { | 51 { |
70 return new tree_function_def (fcn, line (), column ()); | 52 return new tree_function_def (fcn, line (), column ()); |