diff options
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/io.boot | 5 | ||||
-rw-r--r-- | src/interp/preparse.lisp | 6 |
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|))) |