diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-04-15 05:45:46 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-04-15 05:45:46 -0700 |
commit | fff6c80a0f7dd2c90033a48444aad0db36ff9b80 (patch) | |
tree | 976646fd45fe2f7f9e48f7fad7599512952ef24b /parser.y | |
parent | 4c97482494e6170733f4b2143199cff3abec5419 (diff) | |
download | txr-fff6c80a0f7dd2c90033a48444aad0db36ff9b80.tar.gz txr-fff6c80a0f7dd2c90033a48444aad0db36ff9b80.tar.bz2 txr-fff6c80a0f7dd2c90033a48444aad0db36ff9b80.zip |
Allow quasiquotes in braces and quasiliterals, and quotes in braces.
* parser.l: Consolidate rules for recognizing quote, unquote, and
quasiquote. An effect of this is that quasiquotes can now occur in
braces and in string quasiliterals.
* parser.y (quasi_item): Support quotes and quasiquotes as quasi items:
that is to say, i.e. objects denoted by @ in a quasiliteral.
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -949,6 +949,8 @@ quasi_item : litchars { $$ = lit_char_helper($1); } | METANUM { $$ = cons(var_s, cons($1, nil)); rl($$, num(parser->lineno)); } | list { $$ = rlcp(cons(expr_s, $1), $1); } + | '\'' n_expr { $$ = rlcp(cons(expr_s, list(quote_s, $2, nao)), $2); } + | '^' n_expr { $$ = rlcp(cons(expr_s, list(sys_qquote_s, $2, nao)), $2); } | ',' n_expr { $$ = rlcp(cons(expr_s, list(sys_unquote_s, $2, nao)), $2); } | SPLICE n_expr { $$ = rlcp(cons(expr_s, list(sys_splice_s, $2, nao)), $2); } ; |