summaryrefslogtreecommitdiffstats
path: root/tests/012/quasi.tl
Commit message (Collapse)AuthorAgeFilesLines
* expander: bug: atoms in quasiliteral.Kaz Kylheku2021-06-151-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Via macros, atoms can sneak into a quasiliteral which then blow up because they get treated as strings without being converted. Example: (defmacro two () 2) `@(two)xyz` -> ;; error The expansion produces the invalid form, in which the 2 is subsequently treated as a string. (sys:quasi 2 "xyz") On the other hand, symbol macros don't have this problem: (defsymacro two 2) `@{two}xyz` -> "2xyz" The reason is that the (sys:var two) syntax will expand to (sys:var 2), and not 2. The straightforward, consistent fix is to ensure that the first case will also go to (sys:var 2). * eval.c (expand_quasi): If the expanded form is an atom which is not a bindable symbol, wrap it in a sys:var. * tests/012/quasi.tl: Test cases added. Also adding a compilation test for this file, cribbed from patmatch.tl.
* Test cases for macros in quasiliterals.Kaz Kylheku2017-01-181-0/+11
| | | | * tests/012/quasi.tl: New tests added.
* Fix broken @@@<n>/@@@rest references in quasiliterals.Kaz Kylheku2015-08-191-0/+4
| | | | | | | | * parser.y (quasi_meta_helper): When obj is a sys:var, leave it alone; don't add another layer of var. Also, do the same if it is a sys:expr. * tests/012/quasi.tl: Added test case.
* Quasiquote regression from 110.Kaz Kylheku2015-08-191-0/+8
| | | | | | | | | | | | | | | | 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.
* Quasiliteral tests.Kaz Kylheku2015-07-251-0/+15
* tests/012/quasi.expected: New file. * tests/012/quasi.tl: New file.