summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-10 22:31:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-10 22:31:01 -0700
commitf9c0def5b6049bc600051b928910f724e14af4f5 (patch)
tree03fd27d1f4392d2b04c651646d6d3bec80cbeabe /eval.c
parentd36002e99bd8c844a0f1abdc26e66be7f94409b4 (diff)
downloadtxr-f9c0def5b6049bc600051b928910f724e14af4f5.tar.gz
txr-f9c0def5b6049bc600051b928910f724e14af4f5.tar.bz2
txr-f9c0def5b6049bc600051b928910f724e14af4f5.zip
Dot with no whitespace generates qref syntax.
a.b.(expr ...).c -> (qref a b (expr ...) c) Consing dot requires whitespace. * eval.c (qref_s): New symbol global variable. (eval_init): Initialize qref_s. * eval.h (qref_s): Declared. * parser.l (REQWS): New pattern definition, required whitespace. (grammar): New rules to scan CONSDOT (space required on both sides) and LAMBDOT (space required after). * parser.y (CONSDOT, LAMBDOT): New token types. (list): (. n_expr) rule replaced with LAMBDOT and CONSDOT. (r_exprs): r_exprs . n_expr consing dot rule replaced with CONSDOT. (n_expr): New n_expr . n_expr rule introduced here for producing qref expressions. (yybadtoken): Handle CONSDOT and LAMBDOT. * txr.1: Documented qref dot.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 614e7992..0432931a 100644
--- a/eval.c
+++ b/eval.c
@@ -86,7 +86,7 @@ val gen_s, gun_s, generate_s, rest_s, plus_s;
val promise_s, promise_forced_s, promise_inprogress_s, force_s;
val op_s, ap_s, identity_s, apf_s, ipf_s;
val ret_s, aret_s;
-val hash_lit_s, hash_construct_s;
+val hash_lit_s, hash_construct_s, qref_s;
val vector_lit_s, vector_list_s;
val macro_time_s, with_saved_vars_s, macrolet_s;
val defsymacro_s, symacrolet_s, prof_s;
@@ -4074,6 +4074,7 @@ void eval_init(void)
rest_s = intern(lit("rest"), user_package);
hash_lit_s = intern(lit("hash-construct"), system_package);
hash_construct_s = intern(lit("hash-construct"), user_package);
+ qref_s = intern(lit("qref"), user_package);
vector_lit_s = intern(lit("vector-lit"), system_package);
vector_list_s = intern(lit("vector-list"), user_package);
macro_time_s = intern(lit("macro-time"), user_package);