From eae5fe0959092f282ed41e333562ff649c6e0eb9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 6 Dec 2013 08:53:41 -0800 Subject: * parser.l (regex_parse): Match the simplified grammar now expected in the parser, with no slashes around the regex. Change prefix for diagnostic message. --- parser.l | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'parser.l') 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(); } -- cgit v1.2.3