Marcel Taeumel uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-mt.404.mcz
==================== Summary ====================
Name: Compiler-mt.404
Author: mt
Time: 22 July 2019, 8:40:19.7179 am
UUID: a82bc364-41dc-4671-94b7-7b4b669f3bd4
Ancestors: Compiler-eem.403
(Extracted from Compiler-BD.408)
Replace the code duplication from xLetter which was the same as the step method.
This is done in order to allow customization of the step method without having to modify both places. All other methods already use the explicit step method.
"open code step for speed" no longer applies anyways as a method call is fast enough nowadays.
=============== Diff against Compiler-eem.403 ===============
Item was changed:
----- Method: Scanner>>xLetter (in category 'multi-character scans') -----
xLetter
"Form a word or keyword."
| type |
buffer reset.
[(type := self typeTableAt: hereChar) == #xLetter
or: [type == #xDigit
or: [type == #xUnderscore and:[self allowUnderscoreSelectors]]]] whileTrue:
+ [buffer nextPut: self step].
- ["open code step for speed"
- buffer nextPut: hereChar.
- hereChar := aheadChar.
- aheadChar := source atEnd
- ifTrue: [DoItCharacter]
- ifFalse: [source next]].
tokenType := (type == #xColon and: [aheadChar ~~ $=])
ifTrue:
[buffer nextPut: self step.
"Allow any number of embedded colons in literal symbols"
[(self typeTableAt: hereChar) == #xColon] whileTrue:
[buffer nextPut: self step].
#keyword]
ifFalse:
[#word].
token := buffer contents!
David T. Lewis uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-dtl.844.mcz
==================== Summary ====================
Name: Collections-dtl.844
Author: dtl
Time: 18 July 2019, 8:08:26.956143 pm
UUID: 8b4fd324-ffc3-4805-acd5-196a6f120137
Ancestors: Collections-mt.843
Characters and small floats are immediate objects in Spur and should not implement #nextObject.
=============== Diff against Collections-mt.843 ===============
Item was added:
+ ----- Method: Character>>nextObject (in category 'system primitives') -----
+ nextObject
+ "Characters are immediate objects, and, as such, do not have successors in object memory."
+
+ self shouldNotImplement !
David T. Lewis uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-dtl.1246.mcz
==================== Summary ====================
Name: Kernel-dtl.1246
Author: dtl
Time: 18 July 2019, 8:07:43.108638 pm
UUID: 0ac79852-6ed3-48c8-8b6e-d76b28bdbf18
Ancestors: Kernel-mt.1245
Characters and small floats are immediate objects in Spur and should not implement #nextObject.
=============== Diff against Kernel-mt.1245 ===============
Item was added:
+ ----- Method: SmallFloat64>>nextObject (in category 'system primitives') -----
+ nextObject
+ "Small floats are immediate objects, and, as such, do not have successors in object memory."
+
+ self shouldNotImplement !
Levente Uzonyi uploaded a new version of ShoutCore to project The Trunk:
http://source.squeak.org/trunk/ShoutCore-ul.65.mcz
==================== Summary ====================
Name: ShoutCore-ul.65
Author: ul
Time: 9 July 2019, 11:00:06.496443 pm
UUID: 5b4b23fe-b7de-4498-a16b-80959cfb1e62
Ancestors: ShoutCore-mt.64
Further SHTextStyler refactorings:
- replaced text instance variable with temporiaries
- removed monitor. backgroundProcess consistency is ensured by atomic execution of certain instructions
- assume that view is never nil. It makes no sense to style when there's no view, and view is always assigned once, when a styler instance is created
=============== Diff against ShoutCore-mt.64 ===============
Item was changed:
Object subclass: #SHTextStyler
+ instanceVariableNames: 'backgroundProcess view stylingEnabled'
- instanceVariableNames: 'backgroundProcess text monitor view stylingEnabled'
classVariableNames: ''
poolDictionaries: ''
category: 'ShoutCore-Styling'!
!SHTextStyler commentStamp: 'tween 8/27/2004 10:54' prior: 0!
I am an Abstract class.
Subclasses of me can create formatted, coloured, and styled copies of Text that is given to them.
They may perform their styling asynchronously, in a background process which I create and manage.
My public interface is...
view: aViewOrMorph - set the view that will receive notifications when styling has completed.
format: aText - modifies aText's string
style: aText - modifies the TextAttributes of aText, but does not change the string, then sends #stylerStyled: to the view.
styleInBackgroundProcess: aText - performs style: in a background process, then sends #stylerStylednBackground: to the view.
styledTextFor: aText - answers a formatted and styled copy of aText
unstyledTextFrom: aText - answers a copy of aText with all TextAttributes removed
Subclasses of me should re-implement...
privateFormat: aText - answer a formatted version of aText; the String may be changed
privateStyle: aText - modify the TextAttributes of aText; but do not change the String
!
Item was removed:
- ----- Method: SHTextStyler>>monitor (in category 'private') -----
- monitor
- ^monitor ifNil: [monitor := Monitor new]!
Item was changed:
----- Method: SHTextStyler>>style: (in category 'styling') -----
style: aText
+
+ | text |
self terminateBackgroundStylingProcess.
+ stylingEnabled ifFalse: [ ^self ].
+ text := aText copy.
+ self privateStyle: text.
+ view stylerStyled: text!
- stylingEnabled ifTrue:[
- text := aText copy.
- self privateStyle: text.
- view ifNotNil:[view stylerStyled: text] ]!
Item was changed:
----- Method: SHTextStyler>>styleInBackgroundProcess: (in category 'styling') -----
styleInBackgroundProcess: aText
+ | text newBackgroundProcess |
self terminateBackgroundStylingProcess.
+ stylingEnabled ifFalse: [ ^self ].
+ text := aText copy.
+ newBackgroundProcess := [
+ self privateStyle: text.
+ Project current addDeferredUIMessage: [
+ view stylerStyledInBackground: text ].
+ Processor activeProcess == backgroundProcess ifTrue: [
+ backgroundProcess := nil ] ] newProcess
+ priority: Processor userBackgroundPriority;
+ yourself.
+ backgroundProcess ifNil: [
+ (backgroundProcess := newBackgroundProcess) resume ]!
-
- stylingEnabled ifTrue: [
- text := aText copy.
- self monitor critical: [
- backgroundProcess := [
- self privateStyle: text.
- view ifNotNil: [:v | Project current addDeferredUIMessage: [v stylerStyledInBackground: text]].
- ] forkAt: Processor userBackgroundPriority] ]
- !
Item was changed:
----- Method: SHTextStyler>>terminateBackgroundStylingProcess (in category 'private') -----
terminateBackgroundStylingProcess
+ "Terminate the background styling process if it exists. Assume that the first two lines are executed atomically."
+ backgroundProcess ifNotNil: [ :backgroundProcessToTerminate |
+ backgroundProcess := nil.
+ backgroundProcessToTerminate terminate ]!
- self monitor critical: [
- backgroundProcess
- ifNotNil: [
- backgroundProcess terminate.
- backgroundProcess := nil]].!
Item was changed:
----- Method: SHTextStyler>>veryDeepInner: (in category 'copying') -----
veryDeepInner: aDeepCopier
+
super veryDeepInner: aDeepCopier.
+ backgroundProcess := nil.
- backgroundProcess := monitor := nil.
- text := text veryDeepCopyWith: aDeepCopier.
view := view veryDeepCopyWith: aDeepCopier!