aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-06-03 13:02:47 +0000
committerdos-reis <gdr@axiomatics.org>2012-06-03 13:02:47 +0000
commitd7eceebe0eb9cd7840f183dcaf294c85794b0db5 (patch)
treec213716e5d6776d95e6e710d81611209522fce4e /src/interp
parentd68adc46e463a7d2cc0dceb1e58a0da06767ba22 (diff)
downloadopen-axiom-d7eceebe0eb9cd7840f183dcaf294c85794b0db5.tar.gz
* interp/lexing.boot (%Line): Now a record structure.
* boot/parser.boot (bpTypeName): Split out of bpTypeAliasDefinition. (bpStruct): Use it. Support parameterized structures. * boot/ast.boot (ctorName): New. (bfEnum): Use it for parameterized enums. (bfRecord): Use it for parameterized records.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/lexing.boot30
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