From c1b0740f9350775b4965e0547a115dc0f31e3ed2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 26 Apr 2021 06:45:02 -0700 Subject: 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. --- share/txr/stdlib/match.tl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3