From b55fa7a69f286149092cd25902871019c6795b9d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 6 Dec 2013 08:47:36 -0800 Subject: * eval.c (eval_init): Update registration of regex-compile to reflect that it has two arguments now. * parser.y (grammar): Update calls to regex_compile to pass two arguments. Since we don't expect regex_compile to parse, we specify the error stream as nil. (spec): The "secret syntax" for a regex is simplified not to include the slashes. This provides better diagnostics for unterminated syntax and requires less string processing to generate. Also, the form returned doesn't have the regex symbol consed onto it, which parse_regex just throws away. * regex.c (regex_compile): Now takes a stream argument. * regex.h (regex_compile): Declaration updated. * txr.1: Updated --- regex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'regex.c') diff --git a/regex.c b/regex.c index c589b0ca..fb22649f 100644 --- a/regex.c +++ b/regex.c @@ -1613,11 +1613,11 @@ static val regex_requires_dv(val exp) } } -val regex_compile(val regex_sexp) +val regex_compile(val regex_sexp, val error_stream) { if (stringp(regex_sexp)) { - regex_sexp = regex_parse(regex_sexp, nil); - return if2(regex_sexp, regex_compile(regex_sexp)); + regex_sexp = regex_parse(regex_sexp, error_stream); + return if2(regex_sexp, regex_compile(regex_sexp, error_stream)); } else if (opt_derivative_regex || regex_requires_dv(regex_sexp)) { return cons(compiled_regex_s, cons(dv_compile_regex(regex_sexp), nil)); } else { -- cgit v1.2.3