However, I've identified a bug (or consistency).
- Identifiers are letter (letter|digit)*
- bootstrap.c accepts the following, and the code works
!
=TextBox
new: lines
|t1|
t1 := TextBox new.
t1 pointer: (t1 basicNew: lines).
^t1
!
- However the parser in lst.st does not. E.g., the following (with the last variable p1)
!Simple
run
|w ww wh wx wy bOK bCancel label field box p1|
causes the following error message:
-> File fileIn: 'app.s'
subclass created: Simple
method inserted: action:
method inserted: notification:
Compile error near line 2: illegal method variable declaration
Simple
file in completed
I've traced (and verified) that the error is caused here
!Parser
readMethodVariables
tokenType = $| ifFalse: [ ^ nil ].
self nextLex.
[ self tokenIsName ]
whileTrue: [ self addTempName: token asSymbol. self nextLex ].
tokenType = $|
ifTrue: [ self nextLex ]
ifFalse: [ self error: 'illegal method variable declaration']
and furthermore, that identifiers are actually treated correctly (tokenIsName)... but the code self addTempName: token asSymbol. fails.
I've checked and the code
var := #abc123.
is not accepted by the parser in lst.st --- but is OK for the bootstrapper.
However, I've identified a bug (or consistency).
!
=TextBox
new: lines
|t1|
t1 := TextBox new.
t1 pointer: (t1 basicNew: lines).
^t1
!
!Simple
run
|w ww wh wx wy bOK bCancel label field box p1|
causes the following error message:
-> File fileIn: 'app.s'
subclass created: Simple
method inserted: action:
method inserted: notification:
Compile error near line 2: illegal method variable declaration
Simple
file in completed
I've traced (and verified) that the error is caused here
!Parser
readMethodVariables
tokenType = $| ifFalse: [ ^ nil ].
self nextLex.
[ self tokenIsName ]
whileTrue: [ self addTempName: token asSymbol. self nextLex ].
tokenType = $|
ifTrue: [ self nextLex ]
ifFalse: [ self error: 'illegal method variable declaration']
and furthermore, that identifiers are actually treated correctly (tokenIsName)... but the code self addTempName: token asSymbol. fails.
I've checked and the code
var := #abc123.
is not accepted by the parser in lst.st --- but is OK for the bootstrapper.