Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.225.mcz
==================== Summary ====================
Name: Compiler-nice.225
Author: nice
Time: 22 February 2012, 2:57:07.872 pm
UUID: 77bbb3ac-e939-4975-a139-f785dc94c17a
Ancestors: Compiler-nice.224
Remove the ugly hack in Parser>>expected: which was modifying the error message insertion mark depending on the fact that we were at end of token stream a,d/or end of source character stream.
Replace it with a proper mark in Scanner>>scanToken that correctly take into account the two step of advance handled by the Scanner (stateful is harmful and require high precision surgery).
While at it, set the error insertion mark after the $ character when offended by Scanner>>xDollar.
This efficiently reduce the number of failures reported by CompilerNotifyngTest in its Tests-nice.144 version.
=============== Diff against Compiler-nice.224 ===============
Item was changed:
----- Method: Parser>>expected: (in category 'error handling') -----
expected: aString
"Notify a problem at token 'here'."
- tokenType == #doIt ifTrue: [hereMark := hereMark + 1].
- hereType == #doIt ifTrue: [hereMark := hereMark + 1].
^ self notify: aString , ' expected' at: hereMark + requestorOffset!
Item was changed:
----- Method: Scanner>>scanToken (in category 'expression types') -----
scanToken
[(tokenType := self typeTableAt: hereChar) == #xDelimiter]
whileTrue: [self step]. "Skip delimiters fast, there almost always is one."
mark := aheadChar == DoItCharacter
+ ifTrue: [hereChar == DoItCharacter
+ ifTrue: [source position + 1]
+ ifFalse: [source position]]
- ifTrue: [source position]
ifFalse: [source position - 1].
(tokenType at: 1) == $x "x as first letter"
ifTrue: [self perform: tokenType "means perform to compute token & type"]
ifFalse: [token := self step asSymbol "else just unique the first char"].
^token!
Item was changed:
----- Method: Scanner>>xDollar (in category 'multi-character scans') -----
xDollar
"Form a Character literal."
+ aheadChar == DoItCharacter
+ ifTrue:
+ [mark := mark + 1. "Let the notification lie behind the dollar"
+ ^self offEnd: 'A Character was expected'].
- aheadChar == DoItCharacter ifTrue: [^self offEnd: 'A Character was expected'].
self step. "pass over $"
token := self step.
tokenType := #character!
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.225.mcz
==================== Summary ====================
Name: Compiler-nice.225
Author: nice
Time: 22 February 2012, 2:57:07.872 pm
UUID: 77bbb3ac-e939-4975-a139-f785dc94c17a
Ancestors: Compiler-nice.224
Remove the ugly hack in Parser>>expected: which was modifying the error message insertion mark depending on the fact that we were at end of token stream a,d/or end of source character stream.
Replace it with a proper mark in Scanner>>scanToken that correctly take into account the two step of advance handled by the Scanner (stateful is harmful and require high precision surgery).
While at it, set the error insertion mark after the $ character when offended by Scanner>>xDollar.
This efficiently reduce the number of failures reported by CompilerNotifyngTest in its Tests-nice.144 version.
=============== Diff against Compiler-nice.224 ===============
Item was changed:
----- Method: Parser>>expected: (in category 'error handling') -----
expected: aString
"Notify a problem at token 'here'."
- tokenType == #doIt ifTrue: [hereMark := hereMark + 1].
- hereType == #doIt ifTrue: [hereMark := hereMark + 1].
^ self notify: aString , ' expected' at: hereMark + requestorOffset!
Item was changed:
----- Method: Scanner>>scanToken (in category 'expression types') -----
scanToken
[(tokenType := self typeTableAt: hereChar) == #xDelimiter]
whileTrue: [self step]. "Skip delimiters fast, there almost always is one."
mark := aheadChar == DoItCharacter
+ ifTrue: [hereChar == DoItCharacter
+ ifTrue: [source position + 1]
+ ifFalse: [source position]]
- ifTrue: [source position]
ifFalse: [source position - 1].
(tokenType at: 1) == $x "x as first letter"
ifTrue: [self perform: tokenType "means perform to compute token & type"]
ifFalse: [token := self step asSymbol "else just unique the first char"].
^token!
Item was changed:
----- Method: Scanner>>xDollar (in category 'multi-character scans') -----
xDollar
"Form a Character literal."
+ aheadChar == DoItCharacter
+ ifTrue:
+ [mark := mark + 1. "Let the notification lie behind the dollar"
+ ^self offEnd: 'A Character was expected'].
- aheadChar == DoItCharacter ifTrue: [^self offEnd: 'A Character was expected'].
self step. "pass over $"
token := self step.
tokenType := #character!
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.225.mcz
==================== Summary ====================
Name: Compiler-nice.225
Author: nice
Time: 22 February 2012, 2:57:07.872 pm
UUID: 77bbb3ac-e939-4975-a139-f785dc94c17a
Ancestors: Compiler-nice.224
Remove the ugly hack in Parser>>expected: which was modifying the error message insertion mark depending on the fact that we were at end of token stream a,d/or end of source character stream.
Replace it with a proper mark in Scanner>>scanToken that correctly take into account the two step of advance handled by the Scanner (stateful is harmful and require high precision surgery).
While at it, set the error insertion mark after the $ character when offended by Scanner>>xDollar.
This efficiently reduce the number of failures reported by CompilerNotifyngTest in its Tests-nice.144 version.
=============== Diff against Compiler-nice.224 ===============
Item was changed:
----- Method: Parser>>expected: (in category 'error handling') -----
expected: aString
"Notify a problem at token 'here'."
- tokenType == #doIt ifTrue: [hereMark := hereMark + 1].
- hereType == #doIt ifTrue: [hereMark := hereMark + 1].
^ self notify: aString , ' expected' at: hereMark + requestorOffset!
Item was changed:
----- Method: Scanner>>scanToken (in category 'expression types') -----
scanToken
[(tokenType := self typeTableAt: hereChar) == #xDelimiter]
whileTrue: [self step]. "Skip delimiters fast, there almost always is one."
mark := aheadChar == DoItCharacter
+ ifTrue: [hereChar == DoItCharacter
+ ifTrue: [source position + 1]
+ ifFalse: [source position]]
- ifTrue: [source position]
ifFalse: [source position - 1].
(tokenType at: 1) == $x "x as first letter"
ifTrue: [self perform: tokenType "means perform to compute token & type"]
ifFalse: [token := self step asSymbol "else just unique the first char"].
^token!
Item was changed:
----- Method: Scanner>>xDollar (in category 'multi-character scans') -----
xDollar
"Form a Character literal."
+ aheadChar == DoItCharacter
+ ifTrue:
+ [mark := mark + 1. "Let the notification lie behind the dollar"
+ ^self offEnd: 'A Character was expected'].
- aheadChar == DoItCharacter ifTrue: [^self offEnd: 'A Character was expected'].
self step. "pass over $"
token := self step.
tokenType := #character!
Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.611.mcz
==================== Summary ====================
Name: Morphic-nice.611
Author: nice
Time: 22 February 2012, 2:57:33.901 am
UUID: 090dee16-7401-427a-8e8f-c40c375793a1
Ancestors: Morphic-cmm.610
Avoid the compiler notification offset to be doubled when evaluating a sub-selection in a TextEditor.
Notes:
In Squeak, the notification offset is already taken into account in the source Stream because of
TextEditor>>selectionAsStream
"Answer a ReadStream on the text in the paragraph that is currently selected."
^ReadWriteStream
on: paragraph string
from: self startIndex
to: self stopIndex - 1
So it is not necessary to add the self startIndex offset one more time in TextEditor>>notify:at:in:
This might differ from Cuis solution.
=============== Diff against Morphic-cmm.610 ===============
Item was changed:
----- Method: TextEditor>>notify:at:in: (in category 'new selection') -----
notify: aString at: anInteger in: aStream
"The compilation of text failed. The syntax error is noted as the argument,
aString. Insert it in the text at starting character position anInteger."
+ self insertAndSelect: aString at: (anInteger max: 1)!
- | pos |
- pos := self selectionInterval notEmpty
- ifTrue: [
- self startIndex + anInteger - 1 ]
- ifFalse: [anInteger].
- self insertAndSelect: aString at: (pos max: 1)!
Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.611.mcz
==================== Summary ====================
Name: Morphic-nice.611
Author: nice
Time: 22 February 2012, 2:57:33.901 am
UUID: 090dee16-7401-427a-8e8f-c40c375793a1
Ancestors: Morphic-cmm.610
Avoid the compiler notification offset to be doubled when evaluating a sub-selection in a TextEditor.
Notes:
In Squeak, the notification offset is already taken into account in the source Stream because of
TextEditor>>selectionAsStream
"Answer a ReadStream on the text in the paragraph that is currently selected."
^ReadWriteStream
on: paragraph string
from: self startIndex
to: self stopIndex - 1
So it is not necessary to add the self startIndex offset one more time in TextEditor>>notify:at:in:
This might differ from Cuis solution.
=============== Diff against Morphic-cmm.610 ===============
Item was changed:
----- Method: TextEditor>>notify:at:in: (in category 'new selection') -----
notify: aString at: anInteger in: aStream
"The compilation of text failed. The syntax error is noted as the argument,
aString. Insert it in the text at starting character position anInteger."
+ self insertAndSelect: aString at: (anInteger max: 1)!
- | pos |
- pos := self selectionInterval notEmpty
- ifTrue: [
- self startIndex + anInteger - 1 ]
- ifFalse: [anInteger].
- self insertAndSelect: aString at: (pos max: 1)!
Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.611.mcz
==================== Summary ====================
Name: Morphic-nice.611
Author: nice
Time: 22 February 2012, 2:57:33.901 am
UUID: 090dee16-7401-427a-8e8f-c40c375793a1
Ancestors: Morphic-cmm.610
Avoid the compiler notification offset to be doubled when evaluating a sub-selection in a TextEditor.
Notes:
In Squeak, the notification offset is already taken into account in the source Stream because of
TextEditor>>selectionAsStream
"Answer a ReadStream on the text in the paragraph that is currently selected."
^ReadWriteStream
on: paragraph string
from: self startIndex
to: self stopIndex - 1
So it is not necessary to add the self startIndex offset one more time in TextEditor>>notify:at:in:
This might differ from Cuis solution.
=============== Diff against Morphic-cmm.610 ===============
Item was changed:
----- Method: TextEditor>>notify:at:in: (in category 'new selection') -----
notify: aString at: anInteger in: aStream
"The compilation of text failed. The syntax error is noted as the argument,
aString. Insert it in the text at starting character position anInteger."
+ self insertAndSelect: aString at: (anInteger max: 1)!
- | pos |
- pos := self selectionInterval notEmpty
- ifTrue: [
- self startIndex + anInteger - 1 ]
- ifFalse: [anInteger].
- self insertAndSelect: aString at: (pos max: 1)!
Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.143.mcz
==================== Summary ====================
Name: Tests-nice.143
Author: nice
Time: 21 February 2012, 9:30:31.306 pm
UUID: a5d77cf3-e35f-48e2-b45b-7c5c8b3d29bb
Ancestors: Tests-nice.142
Change PackageDependencyTest>>testMorphic
to reflect that Morphic does not seem to depend on ST80 anymore
=============== Diff against Tests-nice.142 ===============
Item was changed:
----- Method: PackageDependencyTest>>testMorphic (in category 'tests') -----
testMorphic
self testPackage: 'Morphic' dependsExactlyOn: #(
Balloon
Collections
Compiler
EToys
Exceptions
Files
Graphics
Kernel
Monticello
MonticelloConfigurations
MorphicExtras
Multilingual
Network
- ST80
Sound
System
'ToolBuilder-Kernel'
'ToolBuilder-Morphic'
Tools
TrueType
).!
Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.143.mcz
==================== Summary ====================
Name: Tests-nice.143
Author: nice
Time: 21 February 2012, 9:30:31.306 pm
UUID: a5d77cf3-e35f-48e2-b45b-7c5c8b3d29bb
Ancestors: Tests-nice.142
Change PackageDependencyTest>>testMorphic
to reflect that Morphic does not seem to depend on ST80 anymore
=============== Diff against Tests-nice.142 ===============
Item was changed:
----- Method: PackageDependencyTest>>testMorphic (in category 'tests') -----
testMorphic
self testPackage: 'Morphic' dependsExactlyOn: #(
Balloon
Collections
Compiler
EToys
Exceptions
Files
Graphics
Kernel
Monticello
MonticelloConfigurations
MorphicExtras
Multilingual
Network
- ST80
Sound
System
'ToolBuilder-Kernel'
'ToolBuilder-Morphic'
Tools
TrueType
).!
Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.143.mcz
==================== Summary ====================
Name: Tests-nice.143
Author: nice
Time: 21 February 2012, 9:30:31.306 pm
UUID: a5d77cf3-e35f-48e2-b45b-7c5c8b3d29bb
Ancestors: Tests-nice.142
Change PackageDependencyTest>>testMorphic
to reflect that Morphic does not seem to depend on ST80 anymore
=============== Diff against Tests-nice.142 ===============
Item was changed:
----- Method: PackageDependencyTest>>testMorphic (in category 'tests') -----
testMorphic
self testPackage: 'Morphic' dependsExactlyOn: #(
Balloon
Collections
Compiler
EToys
Exceptions
Files
Graphics
Kernel
Monticello
MonticelloConfigurations
MorphicExtras
Multilingual
Network
- ST80
Sound
System
'ToolBuilder-Kernel'
'ToolBuilder-Morphic'
Tools
TrueType
).!