diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-12-27 13:26:01 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-12-27 13:26:01 -0800 |
commit | 724187e4d22b26cc81e1d7b0d9b95306cbddc9e2 (patch) | |
tree | b13d13aab6176e6a8f004b7fdd1272cbdd3e2d72 /tests/011/patmatch.tl | |
parent | 3f6a55831805e755812aef6ddd4197384dbc822d (diff) | |
download | txr-724187e4d22b26cc81e1d7b0d9b95306cbddc9e2.tar.gz txr-724187e4d22b26cc81e1d7b0d9b95306cbddc9e2.tar.bz2 txr-724187e4d22b26cc81e1d7b0d9b95306cbddc9e2.zip |
match: allow bound variables with regex modifier.
* stdlib/match.tl (expand-quasi-match): Add regex cases with
bound variable.
* tests/011/patmatch.tl: Test cases for this.
* txr.1: Documented.
Diffstat (limited to 'tests/011/patmatch.tl')
-rw-r--r-- | tests/011/patmatch.tl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/011/patmatch.tl b/tests/011/patmatch.tl index fbdd3da0..4b44eca9 100644 --- a/tests/011/patmatch.tl +++ b/tests/011/patmatch.tl @@ -417,6 +417,12 @@ (let ((a "$")) (test (when-match `@a-@b` "$-@" b) "@")) +(mtest + (when-match `@{a #/\d+/}-@{a #/\d+/}` "123-123" a) "123" + (when-match `@{a #/\d+/}-@{a #/\d+/}-` "123-123-" a) "123" + (when-match `@{a #/\d+/}-@{a #/\d+/}` "123-1234" a) nil + (when-match `@{a #/\d+/}-@{a #/\d+/}-` "123-1234-" a) nil) + (test (build (each-match (`(@a) @b-@c` '("x" |