diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-12-06 08:53:41 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-12-06 08:53:41 -0800 |
commit | eae5fe0959092f282ed41e333562ff649c6e0eb9 (patch) | |
tree | 44149dc96d43fc427db7da2430d36b8c15413309 | |
parent | b55fa7a69f286149092cd25902871019c6795b9d (diff) | |
download | txr-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-- | ChangeLog | 6 | ||||
-rw-r--r-- | parser.l | 8 |
2 files changed, 11 insertions, 3 deletions
@@ -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. @@ -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(); } |