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, 8 insertions, 3 deletions
diff --git a/src/interp/io.boot b/src/interp/io.boot index 1e94a4be..17fa032b 100644 --- a/src/interp/io.boot +++ b/src/interp/io.boot @@ -92,3 +92,8 @@ expandLeadingTabs line == indLoc := indentationLocation line nbLoc = indLoc => line strconc(makeString(indLoc,char " "), subString(line,nbLoc)) + +findChar(c,s,k == 0) == + or/[i for i in k..maxIndex s | stringChar(s,i) = c] + + diff --git a/src/interp/preparse.lisp b/src/interp/preparse.lisp index 90083fcb..1f83d525 100644 --- a/src/interp/preparse.lisp +++ b/src/interp/preparse.lisp @@ -104,11 +104,11 @@ (if (EQ L 0) (GO READLOOP)) (setq PSLOC SLOC) (setq I 0 INSTRING () PCOUNT 0) - STRLOOP (setq STRSYM (OR (position #\" A :start I ) L)) + 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 OPARSYM (OR (position #\( A :start I ) L)) - (setq CPARSYM (OR (position #\) A :start I ) L)) + (setq OPARSYM (OR (|findChar| #\( A I) L)) + (setq CPARSYM (OR (|findChar| #\) A I) L)) (setq N (MIN STRSYM COMSYM NCOMSYM OPARSYM CPARSYM)) (cond ((= N L) (GO NOCOMS)) ((|escaped?| A N)) |