diff options
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/lexing.boot | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/interp/lexing.boot b/src/interp/lexing.boot index 426e1fbc..09fbd7d5 100644 --- a/src/interp/lexing.boot +++ b/src/interp/lexing.boot @@ -47,28 +47,20 @@ module lexing where --% --% Line abstract datatype ---% structure Line == ---% Record(buffer: String, curChar: Character, ---% curIdx: SingleInteger, lstIdx: SingleInteger, lineNo: SingleInteger) --% -makeLine(buf == makeString 0, ch == charByName "Return", - curIdx == 1, lstIdx == 0, no == 0) == - [buf,ch,curIdx,lstIdx,no] - -macro lineBuffer l == - first l - -macro lineCurrentChar l == - second l +structure %Line == + Record(buf: %String, cchar: %Char, cidx: %Short, + lidx: %Short, no: %Short) with + lineBuffer == (.buf) -- input string buffer + lineCurrentChar == (.cchar) -- current character + lineCurrentIndex == (.cidx) -- current index + lineLastIndex == (.lidx) -- last valid index + lineNumber == (.no) -- line number -macro lineCurrentIndex l == - third l -macro lineLastIndex l == - fourth l - -macro lineNumber l == - fifth l +makeLine(buf == makeString 0, ch == charByName "Return", + curIdx == 1, lstIdx == 0, no == 0) == + mk%Line(buf,ch,curIdx,lstIdx,no) lineClear! l == lineBuffer(l) := makeString 0 |