summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-04-10 03:11:09 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-04-10 03:11:09 -0700
commitd228557c3c400ba7a81ba0b0fd867ec78bb35015 (patch)
tree0a5aaca7ead1d53d89a30fab76b2263838cd2f98 /eval.c
parentd26540493a85fe2f4e85da81504cc0264df0c11f (diff)
downloadtxr-d228557c3c400ba7a81ba0b0fd867ec78bb35015.tar.gz
txr-d228557c3c400ba7a81ba0b0fd867ec78bb35015.tar.bz2
txr-d228557c3c400ba7a81ba0b0fd867ec78bb35015.zip
* eval.c (eval_init): Expose regex-compile and regexp as intrinsics.
* lib.c (obj_init): Change spelling of nongreedy operator and put it into the user package so that it is available for use with regex-compile. * regex.c (match_regex, search_regex): Bugfix: optional start position argument argument not defaulting to zero. * txr.1: Documented regex-compile and regexp. * txr.vim: Highlighting regex-compile and regexp.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index c683a0b3..960ca4be 100644
--- a/eval.c
+++ b/eval.c
@@ -2221,10 +2221,13 @@ void eval_init(void)
reg_fun(intern(lit("max"), user_package), func_n1v(maxv));
reg_fun(intern(lit("min"), user_package), func_n1v(minv));
+ reg_fun(intern(lit("regex-compile"), user_package), func_n1(regex_compile));
+ reg_fun(intern(lit("regexp"), user_package), func_n1(regexp));
reg_fun(intern(lit("search-regex"), user_package), func_n4o(search_regex, 2));
reg_fun(intern(lit("match-regex"), user_package), func_n3o(match_regex, 2));
reg_fun(intern(lit("regsub"), user_package), func_n3(regsub));
+
reg_fun(intern(lit("make-hash"), user_package), func_n3(make_hash));
reg_fun(intern(lit("hash"), user_package), func_n0v(hashv));
reg_fun(intern(lit("hash-construct"), user_package), func_n2(hash_construct));