From f7ba5aa3dec20e2371ff9be8c7a9973a3a08cba8 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 16 Apr 2011 17:40:37 +0000 Subject: cleanup --- src/interp/br-search.boot | 10 +++++----- src/interp/format.boot | 4 ++-- src/interp/i-output.boot | 4 ++-- src/interp/i-syscmd.boot | 15 ++++++++------- src/interp/interop.boot | 6 +++--- src/interp/msgdb.boot | 8 ++++---- src/interp/nrunfast.boot | 12 ++++++------ 7 files changed, 30 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/interp/br-search.boot b/src/interp/br-search.boot index c7f24eed..35a803d6 100644 --- a/src/interp/br-search.boot +++ b/src/interp/br-search.boot @@ -699,12 +699,12 @@ dbString2Words l == $dbDelimiters := [char " " , char "(", char ")"] dbWordFrom(l,i) == - maxIndex := MAXINDEX l - while maxIndex >= i and l.i = char " " repeat i := i + 1 - if maxIndex >= i and member(l.i, $dbDelimiters) then return [l.i, i + 1] - k := or/[j for j in i..maxIndex | not member(l.j, $dbDelimiters)] or return nil + idxmax := MAXINDEX l + while idxmax >= i and l.i = char " " repeat i := i + 1 + if idxmax >= i and member(l.i, $dbDelimiters) then return [l.i, i + 1] + k := or/[j for j in i..idxmax | not member(l.j, $dbDelimiters)] or return nil buf := '"" - while k <= maxIndex and not member(c := l.k, $dbDelimiters) repeat + while k <= idxmax and not member(c := l.k, $dbDelimiters) repeat ch := c = char '__ => l.(k := 1+k) --this may exceed bounds c diff --git a/src/interp/format.boot b/src/interp/format.boot index fd82de57..e1caca8a 100644 --- a/src/interp/format.boot +++ b/src/interp/format.boot @@ -586,8 +586,8 @@ numOfSpadArguments id == linearFormatForm(op,argl) == s:= PNAME op indexList:= [readInteger PNAME d for i in 1.. while - (digit? (d:= s.(maxIndex:= i)))] - cleanOp:= makeSymbol (strconc/[PNAME s.i for i in maxIndex..MAXINDEX s]) + (digit? (d:= s.(idxmax:= i)))] + cleanOp:= makeSymbol (strconc/[PNAME s.i for i in idxmax..MAXINDEX s]) fnArgs:= indexList.0 > 0 => concat('"(",formatArgList take(-indexList.0,argl),'")") diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot index 6416f7ef..20c46997 100644 --- a/src/interp/i-output.boot +++ b/src/interp/i-output.boot @@ -747,8 +747,8 @@ mkSuperSub(op,argl) == -- strconc/l s:= PNAME op indexList:= [readInteger PNAME d for i in 1.. while - (digit? (d:= s.(maxIndex:= i)))] - cleanOp:= makeSymbol (strconc/[PNAME s.i for i in maxIndex..MAXINDEX s]) + (digit? (d:= s.(idxmax:= i)))] + cleanOp:= makeSymbol (strconc/[PNAME s.i for i in idxmax..MAXINDEX s]) -- if there is just a subscript use the SUB special form #indexList=2 => subPart:= ['SUB,cleanOp,:take(indexList.1,argl)] diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot index 0722bef6..8812989c 100644 --- a/src/interp/i-syscmd.boot +++ b/src/interp/i-syscmd.boot @@ -205,9 +205,10 @@ commandAmbiguityError(kind,x,u) == getSystemCommandLine() == p := STRPOS('")",$currentLine,0,NIL) line := if p then subString($currentLine,p) else $currentLine - maxIndex:= MAXINDEX line - for i in 0..maxIndex while (line.i ~= " ") repeat index:= i - if index=maxIndex then line := '"" + idxmax:= MAXINDEX line + for i in 0..idxmax while stringChar(line,i) ~= char " " repeat + index:= i + if index=idxmax then line := '"" else line := subString(line,index+2) line @@ -2579,9 +2580,9 @@ processSynonymLine line == line := dropLeadingBlanks line mx := MAXINDEX line for i in 0..mx repeat - line.i = " " => + stringChar(line,i) = char " " => return (for j in (i+1)..mx repeat - line.j ~= " " => return (subString(line, j))) + stringChar(line,j) ~= char " " => return (subString(line, j))) [key, :value] @@ -3194,10 +3195,10 @@ dumbTokenize str == tokenStart := 0 previousSpace := false for i in 0..#str-1 repeat - str.i = char "_"" => + stringChar(str,i) = char "_"" => inString := not inString previousSpace := false - str.i = char " " and not inString => + stringChar(str,i) = char " " and not inString => previousSpace => nil token := stripSpaces subSequence(str, tokenStart, i) tokenList := [token, :tokenList] diff --git a/src/interp/interop.boot b/src/interp/interop.boot index b700041d..62cb156f 100644 --- a/src/interp/interop.boot +++ b/src/interp/interop.boot @@ -463,12 +463,12 @@ hashNewLookupInTable(op,sig,dollar,[domain,opvec],flag) == k := getOpCode(op,opvec,max) or return flag => newLookupInAddChain(op,sig,domain,dollar) nil - maxIndex := MAXINDEX numvec + idxmax := MAXINDEX numvec start := opvec.k finish := QSGREATERP(max,k) => opvec.(QSPLUS(k,2)) - maxIndex - if QSGREATERP(finish,maxIndex) then systemError '"limit too large" + idxmax + if QSGREATERP(finish,idxmax) then systemError '"limit too large" numArgs := if hashCode? sig then -1 else (#sig)-1 success := nil $isDefaultingPackage: local := diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot index 8c12fa01..4103a927 100644 --- a/src/interp/msgdb.boot +++ b/src/interp/msgdb.boot @@ -99,16 +99,16 @@ string2Words l == [w while wordFrom(l,i) is [w,i]] wordFrom(l,i) == - maxIndex := MAXINDEX l - k := or/[j for j in i..maxIndex | stringChar(l,j) ~= char " "] or return nil + idxmax := MAXINDEX l + k := or/[j for j in i..idxmax | stringChar(l,j) ~= char " "] or return nil buf := '"" - while k < maxIndex and (c := stringChar(l,k)) ~= char " " repeat + while k < idxmax and (c := stringChar(l,k)) ~= char " " repeat ch := c = char "__" => stringChar(l,k := 1+k) --this may exceed bounds c buf := strconc(buf,ch) k := k + 1 - if k = maxIndex and (c := stringChar(l,k)) ~= char " " then + if k = idxmax and (c := stringChar(l,k)) ~= char " " then buf := strconc(buf,c) [buf,k+1] diff --git a/src/interp/nrunfast.boot b/src/interp/nrunfast.boot index e74132fb..5c91fc85 100644 --- a/src/interp/nrunfast.boot +++ b/src/interp/nrunfast.boot @@ -188,12 +188,12 @@ newLookupInTable(op,sig,dollar,[domain,opvec],flag) == k := getOpCode(op,opvec,max) or return flag => newLookupInAddChain(op,sig,domain,dollar) nil - maxIndex := MAXINDEX numvec + idxmax := MAXINDEX numvec start := opvec.k finish := QSGREATERP(max,k) => opvec.(QSPLUS(k,2)) - maxIndex - if QSGREATERP(finish,maxIndex) then systemError '"limit too large" + idxmax + if QSGREATERP(finish,idxmax) then systemError '"limit too large" numArgs := QSDIFFERENCE(#sig,1) success := nil $isDefaultingPackage: local := @@ -547,12 +547,12 @@ lookupInDomainByName(op,domain,arg) == predvec := domain.3 max := MAXINDEX opvec k := getOpCode(op,opvec,max) or return nil - maxIndex := MAXINDEX numvec + idxmax := MAXINDEX numvec start := opvec.k finish := QSGREATERP(max,k) => opvec.(QSPLUS(k,2)) - maxIndex - if QSGREATERP(finish,maxIndex) then systemError '"limit too large" + idxmax + if QSGREATERP(finish,idxmax) then systemError '"limit too large" success := false while finish > start repeat i := start -- cgit v1.2.3