class: Scanner
changed: #nextToken
fix: must update tokenPosition when EOF is encountered;
otherwise breakPointCompiler may miss the very last breakpoint
--- a/Scanner.st Fri Jun 21 03:49:37 2013 +0200
+++ b/Scanner.st Fri Jun 21 09:41:48 2013 +0200
@@ -3188,10 +3188,12 @@
hereChar := peekChar.
peekChar := peekChar2.
peekChar2 := nil.
- self eolIsWhiteSpace ifFalse:[
- token := nil.
- tokenType := #EOL.
- ^ tokenType
+ (hereChar == Character cr) ifTrue:[
+ (self eolIsWhiteSpace) ifFalse:[
+ token := nil.
+ tokenType := #EOL.
+ ^ tokenType
+ ].
].
].
].
@@ -3216,6 +3218,9 @@
outCol := outCol + 1.
hereChar == (Character cr) ifTrue:[
self eolIsWhiteSpace ifFalse:[
+ source isPositionable ifTrue:[
+ tokenPosition := source position1Based - 1.
+ ].
token := nil.
tokenType := #EOL.
^ tokenType
@@ -3234,6 +3239,9 @@
outCol := 1
].
self eolIsWhiteSpace ifFalse:[
+ source isPositionable ifTrue:[
+ tokenPosition := source position1Based - 1.
+ ].
token := nil.
tokenType := #EOL.
^ tokenType
@@ -3258,6 +3266,9 @@
]
].
hereChar isNil ifTrue:[
+ source isPositionable ifTrue:[
+ tokenPosition := source position1Based.
+ ].
token := nil.
tokenType := #EOF.
^ tokenType
@@ -3582,11 +3593,11 @@
!Scanner class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.296 2013-06-20 16:59:43 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.297 2013-06-21 07:41:48 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.296 2013-06-20 16:59:43 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Scanner.st,v 1.297 2013-06-21 07:41:48 cg Exp $'
! !