summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parser.y10
-rw-r--r--tests/012/quasi.tl8
2 files changed, 13 insertions, 5 deletions
diff --git a/parser.y b/parser.y
index bfa88a78..04be6aa7 100644
--- a/parser.y
+++ b/parser.y
@@ -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)
diff --git a/tests/012/quasi.tl b/tests/012/quasi.tl
index 4c017b62..7511d4bd 100644
--- a/tests/012/quasi.tl
+++ b/tests/012/quasi.tl
@@ -13,3 +13,11 @@
(let ((a "abc") (b 123))
[(ret `@1-@2-@@1-@@2-@{@1 -4}-@{@2 -4}`) a b])
"abc-123-abc-123- abc- 123")
+
+(test
+ [(ret `@1-@rest`) 1 2 3 4]
+ "1-2 3 4")
+
+(test
+ [(ret `@1-@@rest`) 1 2 3 4]
+ "1-2 3 4")