summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-26 06:45:02 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-26 06:45:02 -0700
commitd21bdaeb403f063301f9b9f023502c032266485d (patch)
tree692b858fdc657fa1d4d5c0b8df1ac145f3b7335d
parent3bba2beeebf52c11fdcb21a0ea52c7ab9c14c701 (diff)
downloadtxr-d21bdaeb403f063301f9b9f023502c032266485d.tar.gz
txr-d21bdaeb403f063301f9b9f023502c032266485d.tar.bz2
txr-d21bdaeb403f063301f9b9f023502c032266485d.zip
matcher: diagnose unhandled quasiliteral cases.
* share/txr/stdlib/match.tl (expand-quasi-match): Close the gap in the expander by diagnosing all unhandled syntax. There is now enough useful functionality and stability to start documenting the feature.
-rw-r--r--share/txr/stdlib/match.tl7
1 files changed, 6 insertions, 1 deletions
diff --git a/share/txr/stdlib/match.tl b/share/txr/stdlib/match.tl
index 514b06c6..f429a9c9 100644
--- a/share/txr/stdlib/match.tl
+++ b/share/txr/stdlib/match.tl
@@ -950,7 +950,12 @@
. @rest)
(compile-error *match-form*
"consecutive unbound variables ~s and ~s"
- sym0 sym1)))))
+ sym0 sym1))
+ ((@bad . @rest) (compile-error *match-form*
+ "unsupported syntax ~s"
+ ^(sys:quasi ,bad)))
+ (@else (compile-error *match-form* "bad quasiliteral syntax")))))
+
(with-gensyms (str pos)
^@(and @(require (sys:var ,str)
(stringp ,str))