From 1fc0c0907f13ef266c5b66546383d5d9cbccb357 Mon Sep 17 00:00:00 2001 Message-Id: From: zbigniew Date: Fri, 9 Jul 2010 23:32:25 -0500 Subject: promote irregex to full unit zbigniew (1): Promote irregex to full unit status; export a few overlooked identifiers defaults.make | 2 +- eval.scm | 2 +- irregex.import.scm | 2 ++ irregex.scm | 26 ++++++++++++++++++++++++++ regex.scm | 19 ++++--------------- rules.make | 19 +++++++++++++++---- 6 files changed, 49 insertions(+), 21 deletions(-) From 1fc0c0907f13ef266c5b66546383d5d9cbccb357 Mon Sep 17 00:00:00 2001 Message-Id: <1fc0c0907f13ef266c5b66546383d5d9cbccb357.1278736345.git.zbigniewsz@gmail.com> In-Reply-To: References: From: zbigniew Date: Fri, 9 Jul 2010 23:29:19 -0500 Subject: Promote irregex to full unit status; export a few overlooked identifiers Signed-off-by: zbigniew --- defaults.make | 2 +- eval.scm | 2 +- irregex.import.scm | 2 ++ irregex.scm | 26 ++++++++++++++++++++++++++ regex.scm | 19 ++++--------------- rules.make | 19 +++++++++++++++---- 6 files changed, 49 insertions(+), 21 deletions(-) diff --git a/defaults.make b/defaults.make index e4e8537..4d6f183 100644 --- a/defaults.make +++ b/defaults.make @@ -325,7 +325,7 @@ IMPORT_LIBRARIES = chicken lolevel srfi-1 srfi-4 data-structures ports files pos regex srfi-14 tcp foreign scheme srfi-18 utils csi irregex IMPORT_LIBRARIES += setup-api setup-download SCRUTINIZED_LIBRARIES = library eval data-structures ports files extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \ - srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \ + srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex irregex scheduler \ profiler stub expand chicken-syntax chicken-ffi-syntax ifdef STATICBUILD diff --git a/eval.scm b/eval.scm index 5655070..114cd90 100644 --- a/eval.scm +++ b/eval.scm @@ -55,7 +55,7 @@ (define-foreign-variable binary-version int "C_BINARY_VERSION") (define ##sys#core-library-modules - '(extras lolevel utils files tcp regex posix srfi-1 srfi-4 srfi-13 + '(extras lolevel utils files tcp regex irregex posix srfi-1 srfi-4 srfi-13 srfi-14 srfi-18 srfi-69 data-structures ports chicken-syntax chicken-ffi-syntax)) diff --git a/irregex.import.scm b/irregex.import.scm index 7fc3bde..22db8dd 100644 --- a/irregex.import.scm +++ b/irregex.import.scm @@ -30,6 +30,8 @@ irregex? irregex-match-data? irregex-new-matches irregex-reset-matches! irregex-match-start irregex-match-end irregex-match-substring + irregex-match-start-index irregex-match-end-index + irregex-match-num-submatches irregex-search irregex-search/matches irregex-match irregex-match-string irregex-fold irregex-replace irregex-replace/all irregex-apply-match irregex-dfa irregex-dfa/search irregex-dfa/extract diff --git a/irregex.scm b/irregex.scm index 5d0f77e..d90ffbf 100644 --- a/irregex.scm +++ b/irregex.scm @@ -30,6 +30,32 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(declare (unit irregex)) + +(declare + (disable-interrupts) + (fixnum) + (export + irregex string->irregex sre->irregex string->sre + irregex? irregex-match-data? + irregex-new-matches irregex-reset-matches! + irregex-match-start irregex-match-end irregex-match-substring + irregex-match-start-index irregex-match-end-index + irregex-match-num-submatches + irregex-search irregex-search/matches irregex-match irregex-match-string + irregex-fold irregex-replace irregex-replace/all irregex-apply-match + irregex-dfa irregex-dfa/search irregex-dfa/extract + irregex-nfa irregex-flags irregex-submatches irregex-lengths irregex-names + )) + +(include "common-declarations.scm") + +(register-feature! 'irregex) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (define irregex-tag '*irregex-tag*) (define (make-irregex dfa dfa/search dfa/extract nfa flags diff --git a/regex.scm b/regex.scm index 526e65a..2ae4e34 100644 --- a/regex.scm +++ b/regex.scm @@ -28,6 +28,7 @@ (declare (unit regex)) (declare + (uses irregex) (disable-interrupts) (fixnum) (export @@ -36,24 +37,12 @@ string-split-fields string-substitute string-substitute* glob->regexp grep - regexp-escape - - irregex string->irregex sre->irregex string->sre - irregex? irregex-match-data? - irregex-new-matches irregex-reset-matches! - irregex-match-start irregex-match-end irregex-match-substring - irregex-match-num-submatches - irregex-search irregex-search/matches irregex-match irregex-match-string - irregex-fold irregex-replace irregex-replace/all irregex-apply-match - irregex-dfa irregex-dfa/search irregex-dfa/extract - irregex-nfa irregex-flags irregex-submatches irregex-lengths irregex-names + regexp-escape )) -(include "common-declarations.scm") +;(include "common-declarations.scm") -(register-feature! 'regex 'irregex) - -(include "irregex.scm") +(register-feature! 'regex) ;;; Record `regexp' diff --git a/rules.make b/rules.make index e6eb692..d0db2e9 100644 --- a/rules.make +++ b/rules.make @@ -30,7 +30,7 @@ VPATH=$(SRCDIR) LIBCHICKEN_OBJECTS_1 = \ library eval data-structures ports files extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \ - srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \ + srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex irregex scheduler \ profiler stub expand chicken-syntax chicken-ffi-syntax runtime LIBCHICKEN_SHARED_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=$(O)) LIBCHICKEN_STATIC_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=-static$(O)) @@ -104,6 +104,10 @@ regex$(O): regex.c chicken.h $(CHICKEN_CONFIG_H) $(C_COMPILER) $(C_COMPILER_OPTIONS) \ $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \ $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT) +irregex$(O): irregex.c chicken.h $(CHICKEN_CONFIG_H) + $(C_COMPILER) $(C_COMPILER_OPTIONS) \ + $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \ + $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT) scheduler$(O): scheduler.c chicken.h $(CHICKEN_CONFIG_H) $(C_COMPILER) $(C_COMPILER_OPTIONS) $(INCLUDES) \ $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \ @@ -220,6 +224,11 @@ regex-static$(O): regex.c chicken.h $(CHICKEN_CONFIG_H) $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \ $(C_COMPILER_STATIC_OPTIONS) \ $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT) +irregex-static$(O): irregex.c chicken.h $(CHICKEN_CONFIG_H) + $(C_COMPILER) $(C_COMPILER_OPTIONS) $(INCLUDES) \ + $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \ + $(C_COMPILER_STATIC_OPTIONS) \ + $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT) scheduler-static$(O): scheduler.c chicken.h $(CHICKEN_CONFIG_H) $(C_COMPILER) $(C_COMPILER_OPTIONS) $(INCLUDES) \ $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \ @@ -864,8 +873,10 @@ posixunix.c: $(SRCDIR)posixunix.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-de $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ posixwin.c: $(SRCDIR)posixwin.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -regex.c: $(SRCDIR)regex.scm $(SRCDIR)irregex.scm $(SRCDIR)common-declarations.scm +regex.c: $(SRCDIR)regex.scm $(SRCDIR)common-declarations.scm $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ +irregex.c: $(SRCDIR)irregex.scm $(SRCDIR)common-declarations.scm + $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ scheduler.c: $(SRCDIR)scheduler.scm $(SRCDIR)common-declarations.scm $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ profiler.c: $(SRCDIR)profiler.scm $(SRCDIR)common-declarations.scm @@ -980,7 +991,7 @@ setup-download.c: $(SRCDIR)setup-download.scm setup-api.c distfiles: library.c eval.c expand.c chicken-syntax.c chicken-ffi-syntax.c \ data-structures.c ports.c files.c extras.c lolevel.c utils.c \ tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c \ - posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \ + posixunix.c posixwin.c regex.c irregex.c scheduler.c profiler.c stub.c \ chicken-profile.c chicken-install.c chicken-uninstall.c chicken-status.c \ csc.c csi.c chicken.c batch-driver.c compiler.c optimizer.c \ compiler-syntax.c scrutinizer.c unboxing.c support.c \ @@ -1023,7 +1034,7 @@ spotless: distclean testclean -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) library.c eval.c data-structures.c \ ports.c files.c extras.c lolevel.c utils.c chicken-syntax.c chicken-ffi-syntax.c \ tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c expand.c \ - posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \ + posixunix.c posixwin.c regex.c irregex.c scheduler.c profiler.c stub.c \ chicken-profile.c chicken-bug.c \ csc.c csi.c chicken-install.c chicken-uninstall.c chicken-status.c \ chicken.c batch-driver.c compiler.c optimizer.c compiler-syntax.c \ -- 1.7.0