diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-12-05 23:18:35 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-12-05 23:18:35 -0800 |
commit | f128b3e3f1ab9fb724d09486b59ae2a2b4cab29c (patch) | |
tree | 0f71acbb110df777c7e30b90c32525e8bd8a9d3e /eval.c | |
parent | 7563a6d0330a4ac02e3e0df169d35f9f395b8d71 (diff) | |
download | txr-f128b3e3f1ab9fb724d09486b59ae2a2b4cab29c.tar.gz txr-f128b3e3f1ab9fb724d09486b59ae2a2b4cab29c.tar.bz2 txr-f128b3e3f1ab9fb724d09486b59ae2a2b4cab29c.zip |
* eval.c (eval_init): Registered regex_parse as new
intrinsic function and std_null as new variable.
* parser.h (yylex_destroy): Existing function declared.
* parser.l (regex_parse): New function.
New lexical syntax added which returns SECRET_ESCAPE_R.
* parser.y (SECRET_ESCAPE_R): New token.
(spec): Added syntactic variant which lets us
smuggle a regex into the parser easily.
* stream.c:x (std_null): New global variable.
(null_stream_print): New static function.
(null_ops): New static structure.
(make_null_stream): New function.
(stream_init): Protect and initialize std_null.
* stream.h (std_null, make_null_stream): Declared.
* txr.1: New features documented: regex-parse, *stdnull*.
* txr.c (txr_main): Call yylex_destroy after parsing the program now
that I know about this function; this can free up some memory.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2312,6 +2312,7 @@ void eval_init(void) 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("regex-parse"), user_package), func_n2o(regex_parse, 1)); reg_fun(intern(lit("make-hash"), user_package), func_n3(make_hash)); reg_fun(intern(lit("make-similar-hash"), user_package), func_n1(make_similar_hash)); @@ -2351,6 +2352,7 @@ void eval_init(void) reg_var(intern(lit("*stddebug*"), user_package), &std_debug); reg_var(intern(lit("*stdin*"), user_package), &std_input); reg_var(intern(lit("*stderr*"), user_package), &std_error); + reg_var(intern(lit("*stdnull*"), user_package), &std_null); reg_fun(intern(lit("format"), user_package), func_n2v(formatv)); reg_fun(intern(lit("print"), user_package), func_n2o(obj_print, 1)); reg_fun(intern(lit("pprint"), user_package), func_n2o(obj_pprint, 1)); |