summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-12-06 08:47:36 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-12-06 08:47:36 -0800
commitb55fa7a69f286149092cd25902871019c6795b9d (patch)
tree7022e5b7b5221194c2c06aa86a74a693e079ad3e /txr.1
parentb26f98511a911537fef73a1925df6d91a7829b6e (diff)
downloadtxr-b55fa7a69f286149092cd25902871019c6795b9d.tar.gz
txr-b55fa7a69f286149092cd25902871019c6795b9d.tar.bz2
txr-b55fa7a69f286149092cd25902871019c6795b9d.zip
* 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
Diffstat (limited to 'txr.1')
-rw-r--r--txr.113
1 files changed, 8 insertions, 5 deletions
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 <form-or-string>)
+ (regex-compile <form-or-string> : <error-stream>)
.TP
Description:
@@ -9363,6 +9363,9 @@ abstract syntax tree first, if by a call to (regex-parse <form-or-string>).
If the parse is successful (the result is not nil) then
it is compiled by a recursive call to regex-compile.
+The optional <error-stream> argument is passed down to regex-compile,
+if that call takes place.
+
.TP
Examples:
@@ -9384,7 +9387,7 @@ Examples:
.TP
Syntax:
- (regex-parse <string> : <stream>)
+ (regex-parse <string> : <error-stream>)
.TP
Description:
@@ -9399,10 +9402,10 @@ function performs this parsing at run-time.
If there are parse errors, the function returns nil.
-The optional <stream> argument specifies a stream to which error messages
+The optional <error-stream> 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 <stream> is specified as t, then the diagnostic
-output goes to the *stdout* stream.
+stream, which discards it. If <error-stream> 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.