summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-12-05 23:47:58 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-12-05 23:47:58 -0800
commit43fa874fd295b2c765cddd14939a60a47e190148 (patch)
tree19e9205efe84ec5b66e1b0b47f8bf732edde9909 /txr.1
parentf128b3e3f1ab9fb724d09486b59ae2a2b4cab29c (diff)
downloadtxr-43fa874fd295b2c765cddd14939a60a47e190148.tar.gz
txr-43fa874fd295b2c765cddd14939a60a47e190148.tar.bz2
txr-43fa874fd295b2c765cddd14939a60a47e190148.zip
* regex.c (regex_compile): Handle string input.
* regex.h (regex_compile): Don't call argument regex_sexp, since it can be a string. * txr.1: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.115
1 files changed, 11 insertions, 4 deletions
diff --git a/txr.1 b/txr.1
index 2906a0ab..ad83f669 100644
--- a/txr.1
+++ b/txr.1
@@ -9348,16 +9348,20 @@ object. For any other object type, it returns nil.
.TP
Syntax:
- (regex-compile <form>)
+ (regex-compile <form-or-string>)
.TP
Description:
The regex compile function takes the source code of a regular expression,
-expressed as a Lisp data structure, and compiles it to a regular expression
-object.
+expressed as a Lisp data structure representing an abstract syntax tree, or
+else a regular expression specified as a character string, and compiles it to a
+regular expression object.
-Suitable source code is produced by regex-parse.
+If <form-or-string> is a character string, it is parsed to an
+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.
.TP
Examples:
@@ -9372,6 +9376,9 @@ Examples:
;; #/a|b|c/
(regex-compile '(or (or #\ea #\eb) #\ec))
+ ;; string
+ (regex-compile "a|b|c")
+
.SS Function regex-parse
.TP