summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-04-19 10:59:29 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-04-19 10:59:29 -0700
commitee0f10607a276ce239ba9ee61420809b766c5715 (patch)
tree27da7b0cbf1100ff8227f2fd1a3bfc54a1acf9ee
parente68b978b40c53b7fef21056c2d1c1dff0b6bb729 (diff)
downloadtxr-ee0f10607a276ce239ba9ee61420809b766c5715.tar.gz
txr-ee0f10607a276ce239ba9ee61420809b766c5715.tar.bz2
txr-ee0f10607a276ce239ba9ee61420809b766c5715.zip
Bugfix: throwing error when trying to print valid regexps.
* regex.c (print_rec): Only dianose "bad object in regex syntax" for some atom other than nil, which denotes an empty (sub)expression, like what results from #// or #/a|/ and such.
-rw-r--r--ChangeLog8
-rw-r--r--regex.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 60472e7c..416496b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2015-04-19 Kaz Kylheku <kaz@kylheku.com>
+ Bugfix: throwing error when trying to print valid regexps.
+
+ * regex.c (print_rec): Only dianose "bad object in regex syntax"
+ for some atom other than nil, which denotes an empty (sub)expression,
+ like what results from #// or #/a|/ and such.
+
+2015-04-19 Kaz Kylheku <kaz@kylheku.com>
+
Do not allow unrecognized escapes in regex.
* parser.l (REGOP): New regex alias for matching all regex
diff --git a/regex.c b/regex.c
index fade9449..b8e7daec 100644
--- a/regex.c
+++ b/regex.c
@@ -1831,7 +1831,7 @@ static void print_rec(val exp, val stream)
} else {
uw_throwf(error_s, lit("bad operator in regex syntax: ~s"), sym, nao);
}
- } else {
+ } else if (exp != nil) {
uw_throwf(error_s, lit("bad object in regex syntax: ~s"), exp, nao);
}
}