ensure that token follows tomeName & tokenValue
(prep to eliminate these two instvars)
--- a/Parser.st Thu Oct 26 11:24:04 2000 +0200
+++ b/Parser.st Thu Oct 26 16:26:02 2000 +0200
@@ -2298,7 +2298,7 @@
position:(source position + newName size - tokenName size).
"redo parse with new value"
- tokenName := newName.
+ token := tokenName := newName.
rslt := self variableOrError:tokenName.
"/ failed again ?
@@ -3346,7 +3346,7 @@
"/ special handling for |, which is also a lexical token
tokenType == $| ifTrue:[
tokenType := #BinaryOperator.
- tokenName := '|'
+ token := tokenName := '|'
].
(tokenType == #BinaryOperator) ifTrue:[
@@ -3884,7 +3884,7 @@
self nextToken
] ifFalse:[
sel := '-'.
- tokenValue := tokenValue negated
+ token := tokenValue := tokenValue negated
]
].
self markSelector:sel from:pos to:(pos + sel size - 1) receiverNode:receiver.
@@ -4484,6 +4484,7 @@
and:[ImmutableString notNil]]) ifTrue:[
tokenValue := tokenValue copy.
tokenValue changeClassTo:ImmutableString.
+ token := tokenValue
].
(tokenType == #Symbol) ifTrue:[
parseForCode ifFalse:[
@@ -5714,6 +5715,6 @@
!Parser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.270 2000-10-25 14:19:06 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.271 2000-10-26 14:26:02 cg Exp $'
! !
Parser initialize!
--- a/Scanner.st Thu Oct 26 11:24:04 2000 +0200
+++ b/Scanner.st Thu Oct 26 16:26:02 2000 +0200
@@ -1269,18 +1269,18 @@
nextCharacter
"a $ has been read - return a character token"
- |nextChar|
+ |nextChar t|
source next.
nextChar := source next.
nextChar notNil ifTrue:[
- tokenValue := token := nextChar.
+ t := nextChar.
tokenType := #Character.
-"/ self markConstantFrom:tokenPosition to:(tokenPosition + 1).
] ifFalse:[
- tokenValue := token := nil.
+ t := nil.
tokenType := #EOF
].
+ tokenValue := token := t.
^ tokenType
"Modified: / 13.5.1998 / 15:09:50 / cg"
@@ -1950,8 +1950,8 @@
'(' , v printString , ')')
position:tokenPosition to:tokenPosition.
source next.
- tokenName := nil.
- tokenType := token := #Error.
+ tokenName := token := nil.
+ tokenType := #Error.
^ #Error
]
].
@@ -2117,6 +2117,6 @@
!Scanner class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.122 2000-10-26 09:24:04 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.123 2000-10-26 14:25:30 cg Exp $'
! !
Scanner initialize!