--- a/Scanner.st Thu May 22 00:23:43 2014 +0200
+++ b/Scanner.st Thu May 22 00:25:02 2014 +0200
@@ -1293,10 +1293,14 @@
!Scanner methodsFor:'error handling'!
+clearErrorFlag
+ errorFlag := false.
+!
+
correctableError:message position:pos1 to:pos2
"report an error which can be corrected by compiler -
- return non-false, if correction is wanted (there is more than
- true/false returned here)"
+ return non-false, if correction is wanted
+ (there is more than true/false returned here)"
|correctIt|
@@ -1307,8 +1311,8 @@
correctIt := requestor correctableError:message position:pos1 to:pos2 from:self
].
- (correctIt == false or:[correctIt == #Error]) ifTrue:[
- errorFlag := true.
+ ("correctIt == false or:["correctIt == #Error"]") ifTrue:[
+ self setErrorFlag.
exitBlock value
].
^ correctIt
@@ -1410,6 +1414,10 @@
"Created: / 28-02-2012 / 14:44:43 / cg"
!
+errorFlag:flagArg
+ errorFlag := flagArg
+!
+
errorMessagePrefix
^ 'Error:'
!
@@ -1417,7 +1425,7 @@
ignorableParseError:message
self parseError:message.
"/ if proceeded, install method anyway (used with non-st/x primitives)
- errorFlag := false.
+ self clearErrorFlag
!
invalidCharacter:ch
@@ -1605,7 +1613,7 @@
"/ fullMessage := (self errorMessagePrefix) , ' ' , (aMessage ? '???').
fullMessage := (aMessage ? 'Unspecified error').
- self errorFlag:true.
+ self setErrorFlag.
self notifyError:fullMessage position:position to:endPos.
exitBlock value.
^ false
@@ -1623,6 +1631,10 @@
"Created: / 16-11-2006 / 14:28:37 / cg"
!
+setErrorFlag
+ errorFlag := true.
+!
+
showErrorMessage:aMessage position:pos
"show an errormessage on the Transcript"
@@ -1657,7 +1669,7 @@
ret := self notifyError:fullMessage position:position to:endPos.
"/ exitBlock value.
"/ ^ false
- errorFlag := true.
+ self setErrorFlag.
^ ret.
"Modified: / 30-06-2011 / 19:49:19 / cg"
@@ -2117,10 +2129,6 @@
!Scanner methodsFor:'parser interface'!
-errorFlag:flagArg
- errorFlag := flagArg
-!
-
token
^ token
!
@@ -2658,9 +2666,13 @@
"an alpha character (or underscore if AllowUnderscore) has been read.
Return the next identifier."
- |nextChar string ok pos ch2 allowUnderscoreInIdentifier|
+ |nextChar string ok pos ch2
+ allowUnderscoreInIdentifier allowDollarInIdentifier
+ allowNationalCharactersInIdentifier|
allowUnderscoreInIdentifier := parserFlags allowUnderscoreInIdentifier.
+ allowDollarInIdentifier := parserFlags allowDollarInIdentifier.
+ allowNationalCharactersInIdentifier := parserFlags allowNationalCharactersInIdentifier.
hereChar == $_ ifTrue:[
"/
@@ -2693,8 +2705,8 @@
nextChar := source peekOrNil.
(((nextChar == $_) and:[allowUnderscoreInIdentifier])
- or:[((nextChar == $$ ) and:[parserFlags allowDollarInIdentifier])
- or:[(nextChar notNil and:[nextChar isNationalLetter]) and:[parserFlags allowNationalCharactersInIdentifier]]]) ifTrue:[
+ or:[((nextChar == $$ ) and:[allowDollarInIdentifier])
+ or:[(nextChar notNil and:[nextChar isNationalLetter]) and:[allowNationalCharactersInIdentifier]]]) ifTrue:[
pos := source position + 1.
nextChar == $_ ifTrue:[
self warnUnderscoreAt:pos.
@@ -2717,8 +2729,8 @@
nextChar := source peekOrNil.
].
ok := ((nextChar == $_) and:[allowUnderscoreInIdentifier])
- or:[((nextChar == $$ ) and:[parserFlags allowDollarInIdentifier])
- or:[(nextChar notNil and:[nextChar isNationalLetter]) and:[parserFlags allowNationalCharactersInIdentifier]]].
+ or:[((nextChar == $$ ) and:[allowDollarInIdentifier])
+ or:[(nextChar notNil and:[nextChar isNationalLetter]) and:[allowNationalCharactersInIdentifier]]].
]
].
].
@@ -3671,11 +3683,11 @@
!Scanner class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.315 2014-05-06 16:37:28 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.316 2014-05-21 22:25:02 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.315 2014-05-06 16:37:28 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.316 2014-05-21 22:25:02 cg Exp $'
! !