From 0c5016a7f39a6a70018949da90f3b9737bf945de Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 16 Dec 2013 23:19:31 -0800 Subject: * lib.c (intern): fix the previous diagnostic bug once more with more feeling. * parser.l (grammar): Recognize package prefixes in symbol tokens. Got rid of special rule for handling lone colon. * parser.y (sym_helper): Catch undefined package as a parsing error rather allowing intern function to throw exception. --- parser.l | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'parser.l') diff --git a/parser.l b/parser.l index ef92db03..2ab713ab 100644 --- a/parser.l +++ b/parser.l @@ -166,9 +166,13 @@ BSYM {BSCHR}({BSCHR}|#)* NSCHR [a-zA-Z0-9!$%&*+\-<=>?\\^_~/] ID_END [^a-zA-Z0-9!$%&*+\-<=>?\\^_~/] NSYM {NSCHR}({NSCHR}|#)* -TOK :?{SYM} -BTOK [:@]?{BSYM} -NTOK [:@]?{NSYM} +TOK {SYM} +BTREG ({BSYM}|@)({BSYM}|#)*(:({BSYM}|#)*)? +BTKEY @?:({BSYM}|#)* +BTOK {BTREG}|{BTKEY} +NTREG ({NSYM}|@)({NSYM}|#)*(:({NSYM}|#)*)? +NTKEY @?:({NSYM}|#)* +NTOK {NTREG}|{NTKEY} WS [\t ]* HEX [0-9A-Fa-f] OCT [0-7] @@ -264,14 +268,6 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} return SYMTOK; } -: { - if (yy_top_state() == INITIAL - || yy_top_state() == QSILIT) - yy_pop_state(); - yylval.lexeme = utf8_dup_from(""); - return SYMTOK; -} - \({WS}all{WS}\) { yy_pop_state(); yylval.lineno = lineno; -- cgit v1.2.3