summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-12-16 23:19:31 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-12-16 23:19:31 -0800
commit0c5016a7f39a6a70018949da90f3b9737bf945de (patch)
tree2adf23155ec3684d04296a100a218f456a2c7afc /parser.l
parent030ce483baef93392d54a4aec90bfa7b5906bc53 (diff)
downloadtxr-0c5016a7f39a6a70018949da90f3b9737bf945de.tar.gz
txr-0c5016a7f39a6a70018949da90f3b9737bf945de.tar.bz2
txr-0c5016a7f39a6a70018949da90f3b9737bf945de.zip
* 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.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l18
1 files changed, 7 insertions, 11 deletions
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;
}
-<BRACED,NESTED>: {
- if (yy_top_state() == INITIAL
- || yy_top_state() == QSILIT)
- yy_pop_state();
- yylval.lexeme = utf8_dup_from("");
- return SYMTOK;
-}
-
<SPECIAL>\({WS}all{WS}\) {
yy_pop_state();
yylval.lineno = lineno;