comparison src/variables.cc @ 1827:effa9400766f

[project @ 1996-02-02 14:07:51 by jwe]
author jwe
date Fri, 02 Feb 1996 14:10:10 +0000
parents 72b1c55692a2
children 99d5b59cb855
comparison
equal deleted inserted replaced
1826:b14829582cc4 1827:effa9400766f
97 97
98 // Attributes of variables and functions. 98 // Attributes of variables and functions.
99 99
100 // Is this variable a builtin? 100 // Is this variable a builtin?
101 101
102 int 102 bool
103 is_builtin_variable (const string& name) 103 is_builtin_variable (const string& name)
104 { 104 {
105 symbol_record *sr = global_sym_tab->lookup (name, 0, 0); 105 symbol_record *sr = global_sym_tab->lookup (name, 0, 0);
106 return (sr && sr->is_builtin_variable ()); 106 return (sr && sr->is_builtin_variable ());
107 } 107 }
108 108
109 // Is this a text-style function? 109 // Is this a text-style function?
110 110
111 int 111 bool
112 is_text_function_name (const string& s) 112 is_text_function_name (const string& s)
113 { 113 {
114 symbol_record *sr = global_sym_tab->lookup (s); 114 symbol_record *sr = global_sym_tab->lookup (s);
115 return (sr && sr->is_text_function ()); 115 return (sr && sr->is_text_function ());
116 } 116 }
117 117
118 // Is this function globally in this scope? 118 // Is this function globally in this scope?
119 119
120 int 120 bool
121 is_globally_visible (const string& name) 121 is_globally_visible (const string& name)
122 { 122 {
123 symbol_record *sr = curr_sym_tab->lookup (name, 0, 0); 123 symbol_record *sr = curr_sym_tab->lookup (name, 0, 0);
124 return (sr && sr->is_linked_to_global ()); 124 return (sr && sr->is_linked_to_global ());
125 } 125 }
760 run_unwind_frame ("parse_fcn_file"); 760 run_unwind_frame ("parse_fcn_file");
761 761
762 return script_file_executed; 762 return script_file_executed;
763 } 763 }
764 764
765 static int 765 static bool
766 load_fcn_from_file (symbol_record *sym_rec, int exec_script) 766 load_fcn_from_file (symbol_record *sym_rec, int exec_script)
767 { 767 {
768 int script_file_executed = 0; 768 bool script_file_executed = false;
769 769
770 string nm = sym_rec->name (); 770 string nm = sym_rec->name ();
771 771
772 if (load_octave_oct_file (nm)) 772 if (load_octave_oct_file (nm))
773 { 773 {
797 } 797 }
798 798
799 return script_file_executed; 799 return script_file_executed;
800 } 800 }
801 801
802 int 802 bool
803 lookup (symbol_record *sym_rec, int exec_script) 803 lookup (symbol_record *sym_rec, int exec_script)
804 { 804 {
805 int script_executed = 0; 805 bool script_executed = false;
806 806
807 if (! sym_rec->is_linked_to_global ()) 807 if (! sym_rec->is_linked_to_global ())
808 { 808 {
809 if (sym_rec->is_defined ()) 809 if (sym_rec->is_defined ())
810 { 810 {
1473 1473
1474 // XXX FIXME XXX -- making ans_id static, passing its address to 1474 // XXX FIXME XXX -- making ans_id static, passing its address to
1475 // tree_simple_assignment_expression along with a flag to not delete 1475 // tree_simple_assignment_expression along with a flag to not delete
1476 // it seems to create a memory leak. Hmm. 1476 // it seems to create a memory leak. Hmm.
1477 1477
1478 tree_simple_assignment_expression tmp_ass (ans_id, tmp, 0, 1); 1478 tree_simple_assignment_expression tmp_ass (ans_id, tmp, false, true);
1479 1479
1480 tmp_ass.eval (print); 1480 tmp_ass.eval (print);
1481 } 1481 }
1482 1482
1483 void 1483 void