diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-01-26 14:38:48 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-01-26 14:38:48 -0800 |
commit | a0533a8a308b4e17e50113b0e8ec5a61cd138ae1 (patch) | |
tree | db60ec5f24ae591958909947f8b112c8debc1a32 /parser.l | |
parent | 24f50b052eb8f8fe3a37d60d0a9e6daebab7f84a (diff) | |
download | txr-a0533a8a308b4e17e50113b0e8ec5a61cd138ae1.tar.gz txr-a0533a8a308b4e17e50113b0e8ec5a61cd138ae1.tar.bz2 txr-a0533a8a308b4e17e50113b0e8ec5a61cd138ae1.zip |
Sigh; more lexical-syntactic hacks. This adds handling
for the @' combination, as in @(bind a @'(foo ,bar))
* parser.l: Handle the new METAQUO token.
* parser.y (METAQUO): New token.
(meta_expr): New "METAQUO expr" case. Added missing METABKT
error handling case.
Diffstat (limited to 'parser.l')
-rw-r--r-- | parser.l | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -432,17 +432,28 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} return yytext[0]; } -<SPECIAL>[(\[] | -<NESTED,BRACED>@?[(\[] { +<SPECIAL,NESTED,BRACED>[(\[] { yy_push_state(NESTED); - if (yytext[0] == '@') { - yylval.chr = yytext[1]; - return yytext[1] == '(' ? METAPAR : METABKT; - } yylval.lineno = lineno; return yytext[0]; } +<NESTED,BRACED>@[(\['] { + yylval.chr = yytext[1]; + yylval.lineno = lineno; + switch (yytext[1]) { + case '(': + yy_push_state(NESTED); + return METAPAR; + case '[': + yy_push_state(NESTED); + return METABKT; + default: + case '\'': + return METAQUO; + } +} + <NESTED>,[*] { yylval.chr = '*'; return SPLICE; |