class: Scanner
added: #didWarnAboutOldStyleAssignment
changed:
#nextIdentifier
#warnOldStyleAssignmentAt:
--- a/Scanner.st Tue Feb 03 15:21:35 2015 +0100
+++ b/Scanner.st Wed Feb 04 11:05:37 2015 +0100
@@ -889,6 +889,10 @@
parserFlags allowUnderscoreInIdentifier:aBoolean
!
+didWarnAboutOldStyleAssignment
+ ^ didWarnAboutOldStyleAssignment ? false
+!
+
parserFlags
^ parserFlags
!
@@ -1728,12 +1732,11 @@
warning:'Old style assignment - please change to use '':='''
doNotShowAgainAction:[ ParserFlags warnOldStyleAssignment:false ]
position:position to:position.
-
- "
- only warn once (per method)
- "
- didWarnAboutOldStyleAssignment := true
- ]
+ ].
+ "
+ only warn once (per method)
+ "
+ didWarnAboutOldStyleAssignment := true
]
]
@@ -2686,7 +2689,7 @@
parserFlags allowOldStyleAssignment ifTrue:[
(nextChar notNil and:[ nextChar isLetterOrDigit or:[nextChar == $_]]) ifFalse:[
"oops: a single underscore is an old-style assignement"
- nextChar ~~ $: ifTrue:[
+ nextChar == $: ifFalse:[
self warnOldStyleAssignmentAt:tokenPosition.
tokenType := token := $_.
^ tokenType
@@ -3722,11 +3725,11 @@
!Scanner class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.328 2015-01-22 23:29:06 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.329 2015-02-04 10:05:37 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.328 2015-01-22 23:29:06 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.329 2015-02-04 10:05:37 cg Exp $'
! !