aboutsummaryrefslogtreecommitdiff
path: root/src/interp/word.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-04-18 10:18:42 +0000
committerdos-reis <gdr@axiomatics.org>2011-04-18 10:18:42 +0000
commit18cdfe64dbe07358b58d06a70b8d6bc2c276769d (patch)
treebd6067535d38995b2df9fcb62fc1cde3d4b98566 /src/interp/word.boot
parentc552f9de83083a649b74510b522ceaebbbc0283b (diff)
downloadopen-axiom-18cdfe64dbe07358b58d06a70b8d6bc2c276769d.tar.gz
cleanup
Diffstat (limited to 'src/interp/word.boot')
-rw-r--r--src/interp/word.boot11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/interp/word.boot b/src/interp/word.boot
index f2bbed07..8d706adc 100644
--- a/src/interp/word.boot
+++ b/src/interp/word.boot
@@ -111,10 +111,10 @@ wordsOfString1(s,j) ==
k := or/[i for i in j..(maxIndex(s)-1) | isBreakCharacter stringChar(s,i)] =>
tailWords:=
isBreakCharacter s.(k+1) =>
- n:= or/[i for i in (k+2)..(maxIndex(s)-1)|not isBreakCharacter s.i]
+ n:= or/[i for i in (k+2)..(maxIndex(s)-1)|not isBreakCharacter stringChar(s,i)]
null n => [subString(s,k)]
n > k+1 => [subString(s,k,n-k-1),:wordsOfString1(s,n-1)]
- m := or/[i for i in (k+2)..(maxIndex(s)-1) | isBreakCharacter s.i] =>
+ m := or/[i for i in (k+2)..(maxIndex(s)-1) | isBreakCharacter stringChar(s,i)] =>
[subString(s,k,m-k),:wordsOfString1(s,m)]
[subString(s,k)]
k > j+1 => [subString(s,j,k-j),:tailWords]
@@ -368,7 +368,8 @@ patternTran pattern ==
maskConvert DOWNCASE pattern
hasWildCard? str ==
- or/[str.i = '_? and (i=0 or not(str.(i-1) = '__ )) for i in 0..maxIndex str]
+ or/[stringChar(str,i) = char "?" and
+ (i=0 or stringChar(str,i-1) ~= char"__" ) for i in 0..maxIndex str]
maskConvert str ==
--replace all ? not preceded by an underscore by &
@@ -376,10 +377,10 @@ maskConvert str ==
j:= 0 --index into res
final := maxIndex str
for i in 0..final repeat
- c := str.i
+ c := stringChar(str,i)
if c = char "__" and i < final then
i := i+1
- c := str.i
+ c := stringChar(str,i)
else if c = char "?" then c := char "&"
SUFFIX(c,buf)
buf