summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-03-25 22:10:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-03-25 22:10:31 -0700
commitf4a6c56c8e8841c1991c1bb44546681ccbdb8f3a (patch)
tree943413daf7f15ed66562552b9cb43c8ada7053d0 /lib.c
parent4c6d387b73dca86caed48b1e786c5c1bc2c4716b (diff)
downloadtxr-f4a6c56c8e8841c1991c1bb44546681ccbdb8f3a.tar.gz
txr-f4a6c56c8e8841c1991c1bb44546681ccbdb8f3a.tar.bz2
txr-f4a6c56c8e8841c1991c1bb44546681ccbdb8f3a.zip
* eval.c (me_quasilist): New static function.
(eval_init): Register me_quasilist as quasilist macro expander. * lib.c (quasilist_s): New global variable. (obj_init): quasilist_s initialized. * lib.h (quasilist_s): Declared. * match.c (do_txreval): Handle quasilist syntax. * parser.l (QWLIT): New exclusive state. Extend lexical grammar to transition to QWLIT state upon the #` or #*` sequence which kicks off a word literal, and in that state, piecewise lexically analyze the QLL, mostly by borrowing rules from quasiliterals. * parser.y (QWORDS, QWSPLICE): New tokens. (n_exprs): Integrate splicing form of QLL syntax. (n_expr): Integrate non-splicing form of QLL syntax. (litchars): Propagate line number info. (quasilit): Fix "string literal" wording in error message. * txr.1: Introduced WLL abbreviation for word list literals, cleaned up the text a little, and documented QLL's.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index def54e2f..edeb8737 100644
--- a/lib.c
+++ b/lib.c
@@ -76,7 +76,8 @@ val var_s, expr_s, regex_s, chset_s, set_s, cset_s, wild_s, oneplus_s;
val nongreedy_s, compiled_regex_s;
val quote_s, qquote_s, unquote_s, splice_s;
val sys_qquote_s, sys_unquote_s, sys_splice_s;
-val zeroplus_s, optional_s, compl_s, compound_s, or_s, and_s, quasi_s;
+val zeroplus_s, optional_s, compl_s, compound_s;
+val or_s, and_s, quasi_s, quasilist_s;
val skip_s, trailer_s, block_s, next_s, freeform_s, fail_s, accept_s;
val all_s, some_s, none_s, maybe_s, cases_s, collect_s, until_s, coll_s;
val define_s, output_s, single_s, first_s, last_s, empty_s;
@@ -5218,6 +5219,7 @@ static void obj_init(void)
or_s = intern(lit("or"), user_package);
and_s = intern(lit("and"), user_package);
quasi_s = intern(lit("quasi"), system_package);
+ quasilist_s = intern(lit("quasilist"), system_package);
skip_s = intern(lit("skip"), user_package);
trailer_s = intern(lit("trailer"), user_package);
block_s = intern(lit("block"), user_package);