summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}
}