Mercurial > hg > octave-avbm
changeset 166:b0a874dca5af
[project @ 1993-10-19 05:11:58 by jwe]
(lookup_identifier): Simplify.
(reset_parser): Reset error_state here.
author | jwe |
---|---|
date | Tue, 19 Oct 1993 05:11:58 +0000 |
parents | 31bd3f646964 |
children | 43074bfdc8c5 |
files | src/lex.l |
diffstat | 1 files changed, 11 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lex.l +++ b/src/lex.l @@ -632,6 +632,7 @@ reset_parser (void) { BEGIN 0; + error_state = 0; promptflag = 1; doing_set = 0; braceflag = 0; @@ -1008,21 +1009,21 @@ } /* - * Try to find an identifier in one symbol table or another. Insert - * it in the local symbol table it is is not already there and it does - * not already have global scope. + * Try to find an identifier in one symbol table or another. */ static symbol_record * lookup_identifier (char *name) { - symbol_record *lsr = curr_sym_tab->lookup (name, 0, 0); - if (lsr != (symbol_record *) NULL) - return lsr; + if (curr_sym_tab == top_level_sym_tab) + { + symbol_record *lsr = curr_sym_tab->lookup (name, 0, 0); + if (lsr != (symbol_record *) NULL) + return lsr; - symbol_record *gsr = global_sym_tab->lookup (name, 0, 0); - if (curr_sym_tab == top_level_sym_tab && gsr != (symbol_record *) NULL - && ! (looping || iffing)) - return gsr; + symbol_record *gsr = global_sym_tab->lookup (name, 0, 0); + if (gsr != (symbol_record *) NULL && ! (looping || iffing)) + return gsr; + } return curr_sym_tab->lookup (name, 1, 0); }