diff options
author | dos-reis <gdr@axiomatics.org> | 2012-05-28 14:09:02 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-05-28 14:09:02 +0000 |
commit | 62a125276f6dc3acedaf11af209b7e4c02306128 (patch) | |
tree | 81cf15675a49410d21e6277b7e5230b86232fd26 /src/interp | |
parent | 7be5c459a3b8d02d87e3a21edabfbf7227df613c (diff) | |
download | open-axiom-62a125276f6dc3acedaf11af209b7e4c02306128.tar.gz |
* interp/io.boot (findChar): Do not define here.
* interp/match.boot (charPosition): Likewise.
* boot/utility.boot (charPosition): Now return argument string
length if no match.
(findChar): New.
* boot/scanner.boot (lexerCharPosition): Adjust.
(shoeAccumulateLines): Use findChar.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/io.boot | 3 | ||||
-rw-r--r-- | src/interp/match.boot | 9 |
2 files changed, 0 insertions, 12 deletions
diff --git a/src/interp/io.boot b/src/interp/io.boot index 2191c3d8..f7a35617 100644 --- a/src/interp/io.boot +++ b/src/interp/io.boot @@ -93,9 +93,6 @@ expandLeadingTabs 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] - ++ Find the position at which `s1' matches a substring of `s2', ++ starting from `k'. Return nil on failure. findString(s1,s2,k == 0) == diff --git a/src/interp/match.boot b/src/interp/match.boot index 7e8144f9..b8c92e10 100644 --- a/src/interp/match.boot +++ b/src/interp/match.boot @@ -56,15 +56,6 @@ anySubstring?(part,whole,startpos) == or/[((k := i) and "and"/[CHAR_-EQUAL(part.ip,whole.iw) for ip in 0..np - 1 for iw in i..]) for i in startpos..nw - np] => k -charPosition(c,t,startpos) == - n := # t - startpos < 0 or startpos > n => n - k:= startpos - for i in startpos .. n-1 repeat - c = t.i => return nil - k := k+1 - k - rightCharPosition(c,t,startpos) == --startpos often equals maxIndex t (rightmost) k := startpos for i in startpos..0 by -1 while c ~= stringChar(t,i) repeat (k := k - 1) |