aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-05-12 00:58:26 +0000
committerdos-reis <gdr@axiomatics.org>2012-05-12 00:58:26 +0000
commitb09aa8e0a8ff6f0957f147c9bcac6f001de949b0 (patch)
tree737d8dfb4b0d4aa9b67293bb9c04701b374c7ce6 /src/interp
parentc4a6434d9caaa918b11d40f38566551067ee034f (diff)
downloadopen-axiom-b09aa8e0a8ff6f0957f147c9bcac6f001de949b0.tar.gz
* interp/io.boot (findString): New.
* interp/preparse.lisp: Use it instead of SEARCH.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/io.boot5
-rw-r--r--src/interp/preparse.lisp6
2 files changed, 7 insertions, 4 deletions
diff --git a/src/interp/io.boot b/src/interp/io.boot
index 17fa032b..87416720 100644
--- a/src/interp/io.boot
+++ b/src/interp/io.boot
@@ -96,4 +96,7 @@ expandLeadingTabs line ==
findChar(c,s,k == 0) ==
or/[i for i in k..maxIndex s | stringChar(s,i) = c]
-
+findString(s1,s2,k == 0) ==
+ n1 := #s1
+ or/[i for i in k..(#s2 - n1) |
+ and/[stringChar(s1,j) = stringChar(s2,i+j) for j in 0..(n1-1)]]
diff --git a/src/interp/preparse.lisp b/src/interp/preparse.lisp
index 1f83d525..9c16a21e 100644
--- a/src/interp/preparse.lisp
+++ b/src/interp/preparse.lisp
@@ -105,8 +105,8 @@
(setq PSLOC SLOC)
(setq I 0 INSTRING () PCOUNT 0)
STRLOOP (setq STRSYM (OR (|findChar| #\" A I) L))
- (setq COMSYM (OR (search "--" A :start2 I ) L))
- (setq NCOMSYM (OR (search "++" A :start2 I ) L))
+ (setq COMSYM (OR (|findString| "--" A I) L))
+ (setq NCOMSYM (OR (|findString| "++" A I) L))
(setq OPARSYM (OR (|findChar| #\( A I) L))
(setq CPARSYM (OR (|findChar| #\) A I) L))
(setq N (MIN STRSYM COMSYM NCOMSYM OPARSYM CPARSYM))
@@ -141,7 +141,7 @@
((setq CONTINUE NIL)))
(if (and (null LINES) (= SLOC 0)) ;;test for skipping constructors
(if (and |$byConstructors|
- (null (search "==>" a))
+ (null (|findString| "==>" a))
(not (member (setq functor (intern
(substring a 0 (STRPOSL ": (=" A 0 NIL))))
|$byConstructors|)))