Ticket #281: irregex-promotion.diff.txt

File irregex-promotion.diff.txt, 9.3 KB (added by Jim Ursetto, 14 years ago)
Line 
1From 1fc0c0907f13ef266c5b66546383d5d9cbccb357 Mon Sep 17 00:00:00 2001
2Message-Id: <cover.1278736345.git.zbigniewsz@gmail.com>
3From: zbigniew <zbigniewsz@gmail.com>
4Date: Fri, 9 Jul 2010 23:32:25 -0500
5Subject: promote irregex to full unit
6
7zbigniew (1):
8  Promote irregex to full unit status; export a few overlooked
9    identifiers
10
11 defaults.make      |    2 +-
12 eval.scm           |    2 +-
13 irregex.import.scm |    2 ++
14 irregex.scm        |   26 ++++++++++++++++++++++++++
15 regex.scm          |   19 ++++---------------
16 rules.make         |   19 +++++++++++++++----
17 6 files changed, 49 insertions(+), 21 deletions(-)
18
19From 1fc0c0907f13ef266c5b66546383d5d9cbccb357 Mon Sep 17 00:00:00 2001
20Message-Id: <1fc0c0907f13ef266c5b66546383d5d9cbccb357.1278736345.git.zbigniewsz@gmail.com>
21In-Reply-To: <cover.1278736345.git.zbigniewsz@gmail.com>
22References: <cover.1278736345.git.zbigniewsz@gmail.com>
23From: zbigniew <zbigniewsz@gmail.com>
24Date: Fri, 9 Jul 2010 23:29:19 -0500
25Subject: Promote irregex to full unit status; export a few overlooked identifiers
26
27
28Signed-off-by: zbigniew <zbigniewsz@gmail.com>
29---
30 defaults.make      |    2 +-
31 eval.scm           |    2 +-
32 irregex.import.scm |    2 ++
33 irregex.scm        |   26 ++++++++++++++++++++++++++
34 regex.scm          |   19 ++++---------------
35 rules.make         |   19 +++++++++++++++----
36 6 files changed, 49 insertions(+), 21 deletions(-)
37
38diff --git a/defaults.make b/defaults.make
39index e4e8537..4d6f183 100644
40--- a/defaults.make
41+++ b/defaults.make
42@@ -325,7 +325,7 @@ IMPORT_LIBRARIES = chicken lolevel srfi-1 srfi-4 data-structures ports files pos
43        regex srfi-14 tcp foreign scheme srfi-18 utils csi irregex
44 IMPORT_LIBRARIES += setup-api setup-download
45 SCRUTINIZED_LIBRARIES = library eval data-structures ports files extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
46-       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \
47+       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex irregex scheduler \
48        profiler stub expand chicken-syntax chicken-ffi-syntax
49 
50 ifdef STATICBUILD
51diff --git a/eval.scm b/eval.scm
52index 5655070..114cd90 100644
53--- a/eval.scm
54+++ b/eval.scm
55@@ -55,7 +55,7 @@
56 (define-foreign-variable binary-version int "C_BINARY_VERSION")
57 
58 (define ##sys#core-library-modules
59-  '(extras lolevel utils files tcp regex posix srfi-1 srfi-4 srfi-13
60+  '(extras lolevel utils files tcp regex irregex posix srfi-1 srfi-4 srfi-13
61           srfi-14 srfi-18 srfi-69 data-structures ports chicken-syntax
62           chicken-ffi-syntax))
63 
64diff --git a/irregex.import.scm b/irregex.import.scm
65index 7fc3bde..22db8dd 100644
66--- a/irregex.import.scm
67+++ b/irregex.import.scm
68@@ -30,6 +30,8 @@
69     irregex? irregex-match-data?
70     irregex-new-matches irregex-reset-matches!
71     irregex-match-start irregex-match-end irregex-match-substring
72+    irregex-match-start-index irregex-match-end-index
73+    irregex-match-num-submatches
74     irregex-search irregex-search/matches irregex-match irregex-match-string
75     irregex-fold irregex-replace irregex-replace/all irregex-apply-match
76     irregex-dfa irregex-dfa/search irregex-dfa/extract
77diff --git a/irregex.scm b/irregex.scm
78index 5d0f77e..d90ffbf 100644
79--- a/irregex.scm
80+++ b/irregex.scm
81@@ -30,6 +30,32 @@
82 
83 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
84 
85+
86+(declare (unit irregex))
87+
88+(declare
89+  (disable-interrupts)
90+  (fixnum)
91+  (export
92+    irregex string->irregex sre->irregex string->sre
93+    irregex? irregex-match-data?
94+    irregex-new-matches irregex-reset-matches!
95+    irregex-match-start irregex-match-end irregex-match-substring
96+    irregex-match-start-index irregex-match-end-index
97+    irregex-match-num-submatches
98+    irregex-search irregex-search/matches irregex-match irregex-match-string
99+    irregex-fold irregex-replace irregex-replace/all irregex-apply-match
100+    irregex-dfa irregex-dfa/search irregex-dfa/extract
101+    irregex-nfa irregex-flags irregex-submatches irregex-lengths irregex-names
102+    ))
103+
104+(include "common-declarations.scm")
105+
106+(register-feature! 'irregex)
107+
108+
109+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
110+
111 (define irregex-tag '*irregex-tag*)
112 
113 (define (make-irregex dfa dfa/search dfa/extract nfa flags
114diff --git a/regex.scm b/regex.scm
115index 526e65a..2ae4e34 100644
116--- a/regex.scm
117+++ b/regex.scm
118@@ -28,6 +28,7 @@
119 (declare (unit regex))
120 
121 (declare
122+  (uses irregex)
123   (disable-interrupts)
124   (fixnum)
125   (export
126@@ -36,24 +37,12 @@
127     string-split-fields string-substitute string-substitute*
128     glob->regexp
129     grep
130-    regexp-escape
131-
132-    irregex string->irregex sre->irregex string->sre
133-    irregex? irregex-match-data?
134-    irregex-new-matches irregex-reset-matches!
135-    irregex-match-start irregex-match-end irregex-match-substring
136-    irregex-match-num-submatches
137-    irregex-search irregex-search/matches irregex-match irregex-match-string
138-    irregex-fold irregex-replace irregex-replace/all irregex-apply-match
139-    irregex-dfa irregex-dfa/search irregex-dfa/extract
140-    irregex-nfa irregex-flags irregex-submatches irregex-lengths irregex-names
141+    regexp-escape
142     ))
143 
144-(include "common-declarations.scm")
145+;(include "common-declarations.scm")
146 
147-(register-feature! 'regex 'irregex)
148-
149-(include "irregex.scm")
150+(register-feature! 'regex)
151 
152 
153 ;;; Record `regexp'
154diff --git a/rules.make b/rules.make
155index e6eb692..d0db2e9 100644
156--- a/rules.make
157+++ b/rules.make
158@@ -30,7 +30,7 @@ VPATH=$(SRCDIR)
159 
160 LIBCHICKEN_OBJECTS_1 = \
161        library eval data-structures ports files extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
162-       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \
163+       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex irregex scheduler \
164        profiler stub expand chicken-syntax chicken-ffi-syntax runtime
165 LIBCHICKEN_SHARED_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=$(O))
166 LIBCHICKEN_STATIC_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=-static$(O))
167@@ -104,6 +104,10 @@ regex$(O): regex.c chicken.h $(CHICKEN_CONFIG_H)
168        $(C_COMPILER) $(C_COMPILER_OPTIONS) \
169          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
170          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
171+irregex$(O): irregex.c chicken.h $(CHICKEN_CONFIG_H)
172+       $(C_COMPILER) $(C_COMPILER_OPTIONS) \
173+         $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
174+         $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
175 scheduler$(O): scheduler.c chicken.h $(CHICKEN_CONFIG_H)
176        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(INCLUDES) \
177          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
178@@ -220,6 +224,11 @@ regex-static$(O): regex.c chicken.h $(CHICKEN_CONFIG_H)
179          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
180          $(C_COMPILER_STATIC_OPTIONS) \
181          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
182+irregex-static$(O): irregex.c chicken.h $(CHICKEN_CONFIG_H)
183+       $(C_COMPILER) $(C_COMPILER_OPTIONS) $(INCLUDES) \
184+         $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
185+         $(C_COMPILER_STATIC_OPTIONS) \
186+         $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
187 scheduler-static$(O): scheduler.c chicken.h $(CHICKEN_CONFIG_H)
188        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(INCLUDES) \
189          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
190@@ -864,8 +873,10 @@ posixunix.c: $(SRCDIR)posixunix.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-de
191        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
192 posixwin.c: $(SRCDIR)posixwin.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm
193        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
194-regex.c: $(SRCDIR)regex.scm $(SRCDIR)irregex.scm $(SRCDIR)common-declarations.scm
195+regex.c: $(SRCDIR)regex.scm $(SRCDIR)common-declarations.scm
196        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
197+irregex.c: $(SRCDIR)irregex.scm $(SRCDIR)common-declarations.scm
198+       $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
199 scheduler.c: $(SRCDIR)scheduler.scm $(SRCDIR)common-declarations.scm
200        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
201 profiler.c: $(SRCDIR)profiler.scm $(SRCDIR)common-declarations.scm
202@@ -980,7 +991,7 @@ setup-download.c: $(SRCDIR)setup-download.scm setup-api.c
203 distfiles: library.c eval.c expand.c chicken-syntax.c chicken-ffi-syntax.c \
204        data-structures.c ports.c files.c extras.c lolevel.c utils.c \
205        tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c \
206-       posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \
207+       posixunix.c posixwin.c regex.c irregex.c scheduler.c profiler.c stub.c \
208        chicken-profile.c chicken-install.c chicken-uninstall.c chicken-status.c \
209        csc.c csi.c chicken.c batch-driver.c compiler.c optimizer.c  \
210        compiler-syntax.c scrutinizer.c unboxing.c support.c \
211@@ -1023,7 +1034,7 @@ spotless: distclean testclean
212        -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) library.c eval.c data-structures.c \
213          ports.c files.c extras.c lolevel.c utils.c chicken-syntax.c chicken-ffi-syntax.c \
214          tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c expand.c \
215-         posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \
216+         posixunix.c posixwin.c regex.c irregex.c scheduler.c profiler.c stub.c \
217          chicken-profile.c chicken-bug.c \
218          csc.c csi.c chicken-install.c chicken-uninstall.c chicken-status.c \
219          chicken.c batch-driver.c compiler.c optimizer.c compiler-syntax.c \
220--
2211.7.0
222