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 --- txr.1 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index ad83f669..980d2976 100644 --- a/txr.1 +++ b/txr.1 @@ -9348,7 +9348,7 @@ object. For any other object type, it returns nil. .TP Syntax: - (regex-compile ) + (regex-compile : ) .TP Description: @@ -9363,6 +9363,9 @@ abstract syntax tree first, if by a call to (regex-parse ). If the parse is successful (the result is not nil) then it is compiled by a recursive call to regex-compile. +The optional argument is passed down to regex-compile, +if that call takes place. + .TP Examples: @@ -9384,7 +9387,7 @@ Examples: .TP Syntax: - (regex-parse : ) + (regex-parse : ) .TP Description: @@ -9399,10 +9402,10 @@ function performs this parsing at run-time. If there are parse errors, the function returns nil. -The optional argument specifies a stream to which error messages +The optional argument specifies a stream to which error messages are sent from the parser. By default, diagnostic output goes to the *stdnull* -stream, which discards it. If is specified as t, then the diagnostic -output goes to the *stdout* stream. +stream, which discards it. If is specified as t, then the +diagnostic output goes to the *stdout* stream. If regex-parse returns a non-nil value, that structure is then something which is suitable as input to regex-compile. -- cgit v1.2.3