diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-19 06:57:20 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-19 06:57:20 -0700 |
commit | fb444e43852b08ff6d1fb74339f7bce780931c4f (patch) | |
tree | 53f8033f79abfd4b21a5c5ff20065b96595976ff /parser.y | |
parent | b2a8b3be8e11cff3fcdf9c2336b26c828b0627fb (diff) | |
download | txr-fb444e43852b08ff6d1fb74339f7bce780931c4f.tar.gz txr-fb444e43852b08ff6d1fb74339f7bce780931c4f.tar.bz2 txr-fb444e43852b08ff6d1fb74339f7bce780931c4f.zip |
Quasiquote regression from 110.
The problem is that one-argument function calls like @(whatever arg) in
a quasiliteral being turned into sys:var items.
* parser.y (quasi_meta_helper): Remove bogus check on length.
The default case is now var, so the var_s check actually matters.
The integerp check for the argument of a var form didn't do
anything because the entire if statment conditionally selected a
useless goto. Removing it for consistent treatment of var items.
* tests/012/quasi.tl: Some new test cases involving @rest.
These new tests pass whether or not we have that integerp(second(obj))
test in the quasi_meta_helper function. Either way @rest and @@rest
produce the same thing.
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1369,17 +1369,17 @@ static val quasi_meta_helper(val obj) if (integerp(obj) || symbolp(obj)) goto var; - if (atom(obj) || length(obj) != two) + if (atom(obj)) goto expr; - if (first(obj) == var_s && integerp(second(obj))) + if (first(obj) == var_s) goto var; -var: - return rlcp_tree(cons(var_s, cons(obj, nil)), obj); - expr: return rlcp(cons(expr_s, obj), obj); + +var: + return rlcp_tree(cons(var_s, cons(obj, nil)), obj); } static void misplaced_consing_dot_check(scanner_t *scanner, val term_atom_cons) |