From 24ea2b8c11bcaa99f1e72df7fee8feb1ad80e5b1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 2 Oct 2014 07:45:20 -0700 Subject: 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. --- lib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib.c') diff --git a/lib.c b/lib.c index fbe6743b..0b107c93 100644 --- a/lib.c +++ b/lib.c @@ -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); -- cgit v1.2.3