summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-12-06 08:53:41 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-12-06 08:53:41 -0800
commiteae5fe0959092f282ed41e333562ff649c6e0eb9 (patch)
tree44149dc96d43fc427db7da2430d36b8c15413309
parentb55fa7a69f286149092cd25902871019c6795b9d (diff)
downloadtxr-eae5fe0959092f282ed41e333562ff649c6e0eb9.tar.gz
txr-eae5fe0959092f282ed41e333562ff649c6e0eb9.tar.bz2
txr-eae5fe0959092f282ed41e333562ff649c6e0eb9.zip
* parser.l (regex_parse): Match the simplified grammar now
expected in the parser, with no slashes around the regex. Change prefix for diagnostic message.
-rw-r--r--ChangeLog6
-rw-r--r--parser.l8
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 4afa1f16..885366af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2013-12-06 Kaz Kylheku <kaz@kylheku.com>
+ * parser.l (regex_parse): Match the simplified grammar now
+ expected in the parser, with no slashes around the regex.
+ Change prefix for diagnostic message.
+
+2013-12-06 Kaz Kylheku <kaz@kylheku.com>
+
* eval.c (eval_init): Update registration of regex-compile
to reflect that it has two arguments now.
diff --git a/parser.l b/parser.l
index 18b4af3b..0370bd2d 100644
--- a/parser.l
+++ b/parser.l
@@ -832,7 +832,7 @@ void parse_reset(val spec_file)
val regex_parse(val string, val error_stream)
{
uses_or2;
- val parse_string = cat_str(list(lit("@\x01R/"), string, lit("/"), nao), nil);
+ val parse_string = cat_str(list(lit("@\x01R"), string, nao), nil);
yyin_stream = make_string_byte_input_stream(parse_string);
errors = 0;
lineno = 1;
@@ -840,11 +840,13 @@ val regex_parse(val string, val error_stream)
std_error = if3(error_stream == t, std_output, or2(error_stream, std_null));
{
int gc = gc_state(0);
- spec_file_str = string;
+ spec_file_str = if3(std_error != std_null,
+ format(nil, lit("regex: ~s"), string, nao),
+ lit(""));
yyparse();
yylex_destroy();
gc_state(gc);
}
std_error = save_stream;
- return errors ? nil : rest(get_spec());
+ return errors ? nil : get_spec();
}