diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-10-02 07:45:20 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-10-02 09:02:35 -0700 |
commit | 24ea2b8c11bcaa99f1e72df7fee8feb1ad80e5b1 (patch) | |
tree | d6dfb786b757737c759810aab17c938927de328a /lib.c | |
parent | badc1562267ee35f8a8fa6f7dcc0751c5c897af6 (diff) | |
download | txr-24ea2b8c11bcaa99f1e72df7fee8feb1ad80e5b1.tar.gz txr-24ea2b8c11bcaa99f1e72df7fee8feb1ad80e5b1.tar.bz2 txr-24ea2b8c11bcaa99f1e72df7fee8feb1ad80e5b1.zip |
Using unified COBJ representation for both regex kinds,
rather than the list-based notation for derivative-based
regexes, and an encapsulated COBJ for NFA-based regexes.
* lib.c (compiled_regex_s): Variable removed.
(obj_init): Initialization of compiled_regex_s removed.
* lib.h (compiled_regex_s): Declaration removed.
* regex.c (struct regex, regex_t): New type.
(regex_destroy): Object is now a regex_t, not nfa_t.
(regex_mark): New function.
(regex_obj_ops): Register regex_mark operation.
(reg_nullable, reg_derivative): Remove cases that handles
compiled_regex_s.
(regex_compile): Output of dv_compile_regex becomes
a cobj nwo. Output of nfa_compile_regex must be
embedded in regex_t structure.
(regexp): Drop the check for compiles_regex_s.
(regex_nfa): Function removed.
(regex_run, regex_machine_init): Use cobj_handle to retrieve regex_t *
pointer and dispatch appropriate code based on regex->kind.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -73,7 +73,7 @@ val null_s, t, cons_s, str_s, chr_s, fixnum_s, sym_s, pkg_s, fun_s, vec_s; val lit_s, stream_s, hash_s, hash_iter_s, lcons_s, lstr_s, cobj_s, cptr_s; val env_s, bignum_s, float_s; val var_s, expr_s, regex_s, chset_s, set_s, cset_s, wild_s, oneplus_s; -val nongreedy_s, compiled_regex_s; +val nongreedy_s; val quote_s, qquote_s, unquote_s, splice_s; val sys_qquote_s, sys_unquote_s, sys_splice_s; val zeroplus_s, optional_s, compl_s, compound_s; @@ -6120,7 +6120,6 @@ static void obj_init(void) expr_s = intern(lit("expr"), system_package); regex_s = intern(lit("regex"), system_package); nongreedy_s = intern(lit("ng0+"), user_package); - compiled_regex_s = intern(lit("compiled-regex"), system_package); quote_s = intern(lit("quote"), user_package); qquote_s = intern(lit("qquote"), user_package); unquote_s = intern(lit("unquote"), user_package); |