# HG changeset patch # User jwe # Date 751007518 0 # Node ID b0a874dca5af8abf1216bec0789388734d80182c # Parent 31bd3f646964493212af16de04ba35d50d113b5e [project @ 1993-10-19 05:11:58 by jwe] (lookup_identifier): Simplify. (reset_parser): Reset error_state here. diff -r 31bd3f646964 -r b0a874dca5af src/lex.l --- a/src/lex.l Tue Oct 19 05:09:48 1993 +0000 +++ b/src/lex.l Tue Oct 19 05:11:58 1993 +0000 @@ -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); }