aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-05-12 00:08:20 +0000
committerdos-reis <gdr@axiomatics.org>2012-05-12 00:08:20 +0000
commitc4a6434d9caaa918b11d40f38566551067ee034f (patch)
tree1cf9414bbd89de02cd388c443df415940ae63ff0 /src/interp
parent90e40ff963ffdca1272e393e2458d04040976096 (diff)
downloadopen-axiom-c4a6434d9caaa918b11d40f38566551067ee034f.tar.gz
* interp/io.boot (findChar): New.
* interp/preparse.lisp (preparse1): Use it instead of POSITION.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/io.boot5
-rw-r--r--src/interp/preparse.lisp6
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))