~ chicken-core (chicken-5) b6a59acb6f4f96d977620f1d001c188e86af2126


commit b6a59acb6f4f96d977620f1d001c188e86af2126
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Thu Jul 15 13:54:39 2010 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Thu Jul 15 13:54:39 2010 +0200

    applied zbigniews irregex-promotion patch

diff --git a/defaults.make b/defaults.make
index e4e8537b..4d6f183f 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 f5d4e322..44a9ed88 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.scm b/irregex-core.scm
similarity index 100%
rename from irregex.scm
rename to irregex-core.scm
diff --git a/irregex.import.scm b/irregex.import.scm
index 7fc3bde7..71f406c9 100644
--- a/irregex.import.scm
+++ b/irregex.import.scm
@@ -26,11 +26,34 @@
 
 (##sys#register-primitive-module
  'irregex
- '(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-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))
+ '(irregex 
+   irregex-apply-match
+   irregex-dfa 
+   irregex-dfa/extract
+   irregex-dfa/search
+   irregex-flags
+   irregex-fold
+   irregex-lengths
+   irregex-match
+   irregex-match-data?
+   irregex-match-end
+   irregex-match-end-index
+   irregex-match-num-submatches
+   irregex-match-start
+   irregex-match-start-index
+   irregex-match-string
+   irregex-match-substring
+   irregex-names
+   irregex-new-matches
+   irregex-nfa
+   irregex-replace
+   irregex-replace/all
+   irregex-reset-matches!
+   irregex-search
+   irregex-search/matches
+   irregex-submatches
+   irregex?
+   sre->irregex
+   string->irregex 
+   string->sre
+   ))
diff --git a/regex.scm b/regex.scm
index 526e65ad..2ae4e34b 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 e6eb692e..9c9efd5b 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)irregex-core.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 \
Trap