comparison src/lex.l @ 195:13c6086c325c

[project @ 1993-11-06 10:12:29 by jwe]
author jwe
date Sat, 06 Nov 1993 10:14:11 +0000
parents b6b4d8c513fe
children 1761d7a3770c
comparison
equal deleted inserted replaced
194:4f3364dcf450 195:13c6086c325c
1035 1035
1036 return 0; 1036 return 0;
1037 } 1037 }
1038 1038
1039 /* 1039 /*
1040 * Try to find an identifier in one symbol table or another. 1040 * Try to find an identifier. All binding to global or builtin
1041 * variables occurs when expressions are evaluated.
1041 */ 1042 */
1042 static symbol_record * 1043 static symbol_record *
1043 lookup_identifier (char *name) 1044 lookup_identifier (char *name)
1044 { 1045 {
1045 if (curr_sym_tab == top_level_sym_tab)
1046 {
1047 symbol_record *lsr = curr_sym_tab->lookup (name, 0, 0);
1048 if (lsr != (symbol_record *) NULL && lsr->is_defined ())
1049 return lsr;
1050
1051 symbol_record *gsr = global_sym_tab->lookup (name, 0, 0);
1052 if (gsr != (symbol_record *) NULL
1053 && ! (looping || iffing)
1054 && (gsr->is_defined () || gsr->is_forced_global ()))
1055 return gsr;
1056 }
1057
1058 return curr_sym_tab->lookup (name, 1, 0); 1046 return curr_sym_tab->lookup (name, 1, 0);
1059 } 1047 }
1060 1048
1061 /* 1049 /*
1062 * Grab the help text from an M-file. 1050 * Grab the help text from an M-file.