summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-21 06:49:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-21 06:49:01 -0700
commit96ca2e8a7799a2b820e6e3e6727f3fe15d56c061 (patch)
tree0f16020cd5c3e463168157f9b6a9932f7cd93099 /parser.c
parentf1f24ca5cfb5fde42405ee2ae3b53eb397e9133c (diff)
downloadtxr-96ca2e8a7799a2b820e6e3e6727f3fe15d56c061.tar.gz
txr-96ca2e8a7799a2b820e6e3e6727f3fe15d56c061.tar.bz2
txr-96ca2e8a7799a2b820e6e3e6727f3fe15d56c061.zip
Regex syntax errors trigger exception.
* parser.c (regex_parse): Don't return nil if there were errors; throw a syntax-error exception.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 865dee7b..f5edfbed 100644
--- a/parser.c
+++ b/parser.c
@@ -281,7 +281,11 @@ val regex_parse(val string, val error_stream)
parser_cleanup(&parser);
std_error = save_stream;
- return parser.errors ? nil : parser.syntax_tree;
+
+ if (parser.errors)
+ uw_throw(syntax_error_s, lit("regex-parse: syntax errors in regex"));
+
+ return parser.syntax_tree;
}
static val lisp_parse_impl(val interactive, val source_in, val error_stream,