summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stdlib/match.tl7
1 files changed, 5 insertions, 2 deletions
diff --git a/stdlib/match.tl b/stdlib/match.tl
index cdc1415c..17870be2 100644
--- a/stdlib/match.tl
+++ b/stdlib/match.tl
@@ -958,8 +958,11 @@
(list ^@(with ,sym (sub-str ,str ,pos t))))
;; `@{var #/rx/}` (new binding)
(((@(eq 'sys:var) @sym (@(regexp @reg))))
- (list ^@(require @(with ,sym (sub-str ,str ,pos t))
- (m^$ ,reg ,sym))))
+ (if sym
+ (list ^@(require @(with ,sym (sub-str ,str ,pos t))
+ (m^$ ,reg ,sym)))
+ (list ^@(require @nil
+ (m^$ ,reg (sub-str ,str ,pos t))))))
;; `@{var #/rx/}@...` (new binding)
(((@(eq 'sys:var) @sym (@(regexp @reg))) . @rest)
(with-gensyms (len npos)