Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.868.mcz
==================== Summary ====================
Name: Collections-nice.868
Author: nice
Time: 28 December 2019, 1:23:35.502843 pm
UUID: e4026d16-31b5-430f-8c22-6475db37bb91
Ancestors: Collections-mt.866
Fix RunArrayTest>>testAt2 (testing access out of bounds)
Beware, Text depends on this feature of accessing runs out of bounds, because the characterIndex might be past end.
To avoid problems, transform previous #at: implementation into #atPin: and use that in Text.
#atPin: clamps the index in accessible range.
=============== Diff against Collections-mt.866 ===============
Item was changed:
----- Method: RunArray>>at: (in category 'accessing') -----
at: index
+ self at: index setRunOffsetAndValue: [:run :offset :value |
+ offset < 0 ifTrue: [ self errorSubscriptBounds: index ].
+ offset >= (runs at: run) ifTrue: [ self errorSubscriptBounds: index ].
+ ^value]!
- self at: index setRunOffsetAndValue: [:run :offset :value | ^value]!
Item was added:
+ ----- Method: RunArray>>atPin: (in category 'accessing') -----
+ atPin: index
+
+ self at: index setRunOffsetAndValue: [:run :offset :value | ^value]!
Item was changed:
----- Method: Text>>alignmentAt:ifAbsent: (in category 'emphasis') -----
alignmentAt: characterIndex ifAbsent: aBlock
| attributes emph |
self size = 0 ifTrue: [^aBlock value].
emph := nil.
+ attributes := runs atPin: characterIndex.
- attributes := runs at: characterIndex.
attributes do:[:att | (att isKindOf: TextAlignment) ifTrue:[emph := att]].
emph ifNil: [ ^aBlock value ].
^emph alignment!
Item was changed:
----- Method: Text>>attributesAt: (in category 'emphasis') -----
attributesAt: characterIndex
"Answer the code for characters in the run beginning at characterIndex."
"NB: no senders any more (supplanted by #attributesAt:forStyle: but retained for the moment in order not to break user code that may exist somewhere that still calls this"
| attributes |
self size = 0
ifTrue: [^ Array with: (TextFontChange new fontNumber: 1)]. "null text tolerates access"
+ attributes := runs atPin: characterIndex.
- attributes := runs at: characterIndex.
^ attributes!
Item was changed:
----- Method: Text>>attributesAt:do: (in category 'emphasis') -----
attributesAt: characterIndex do: aBlock
"Answer the code for characters in the run beginning at characterIndex."
"NB: no senders any more (supplanted by #attributesAt:forStyle: but retained for the moment in order not to break user code that may exist somewhere that still calls this"
self size = 0 ifTrue:[^self].
+ (runs atPin: characterIndex) do: aBlock!
- (runs at: characterIndex) do: aBlock!
Item was changed:
----- Method: Text>>attributesAt:forStyle: (in category 'emphasis') -----
attributesAt: characterIndex forStyle: aTextStyle
"Answer the code for characters in the run beginning at characterIndex."
| attributes |
self size = 0
ifTrue: [^ Array with: (TextFontChange new fontNumber: aTextStyle defaultFontIndex)]. "null text tolerates access"
+ attributes := runs atPin: characterIndex.
- attributes := runs at: characterIndex.
^ attributes!
Item was changed:
----- Method: Text>>colorAt:ifNone: (in category 'emphasis') -----
colorAt: characterIndex ifNone: block
self size = 0 ifTrue: [^ block value]. "null text tolerates access."
+ ^ (runs atPin: characterIndex)
- ^ (runs at: characterIndex)
detect: [:attr | attr class == TextColor]
ifFound: [:attr | attr color]
ifNone: block!
Item was changed:
----- Method: Text>>emphasisAt: (in category 'emphasis') -----
emphasisAt: characterIndex
"Answer the fontfor characters in the run beginning at characterIndex."
| attributes |
self size = 0 ifTrue: [^ 0]. "null text tolerates access"
+ attributes := runs atPin: characterIndex.
- attributes := runs at: characterIndex.
^attributes inject: 0 into:
[:emph :att | emph bitOr: att emphasisCode].
!
Item was changed:
----- Method: Text>>fontAt:withStyle: (in category 'emphasis') -----
fontAt: characterIndex withStyle: aTextStyle
"Answer the fontfor characters in the run beginning at characterIndex."
| attributes font |
self size = 0 ifTrue: [^ aTextStyle defaultFont]. "null text tolerates access"
+ attributes := runs atPin: characterIndex.
- attributes := runs at: characterIndex.
font := aTextStyle defaultFont. "default"
attributes do:
[:att | att forFontInStyle: aTextStyle do: [:f | font := f]].
^ font!
Item was changed:
----- Method: Text>>fontNumberAt: (in category 'emphasis') -----
fontNumberAt: characterIndex
"Answer the fontNumber for characters in the run beginning at characterIndex."
| attributes fontNumber |
self size = 0 ifTrue: [^1]. "null text tolerates access"
+ attributes := runs atPin: characterIndex.
- attributes := runs at: characterIndex.
fontNumber := 1.
attributes do: [:att | (att isMemberOf: TextFontChange) ifTrue: [fontNumber := att fontNumber]].
^ fontNumber
!
Chris Muller uploaded a new version of SUnitGUI to project The Trunk:
http://source.squeak.org/trunk/SUnitGUI-cmm.78.mcz
==================== Summary ====================
Name: SUnitGUI-cmm.78
Author: cmm
Time: 27 December 2019, 10:59:41.297401 pm
UUID: 1c7d7b32-cdec-4875-80d8-7d2413e01a05
Ancestors: SUnitGUI-cmm.77
Fix TestRunner browser for use with Reuse Windows preference. There's no way to spawn that model with any pre-selection, it's essentially a singleton browser in Squeak.
=============== Diff against SUnitGUI-cmm.77 ===============
Item was changed:
----- Method: TestRunner>>representsSameBrowseeAs: (in category 'accessing-ui') -----
representsSameBrowseeAs: anotherModel
+ ^ true!
- ^ self class = anotherModel class
- and: [ classesSelected = anotherModel classesSelected ]!
Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.928.mcz
==================== Summary ====================
Name: Tools-cmm.928
Author: cmm
Time: 20 December 2019, 10:06:10.77308 pm
UUID: e1a28262-590a-443a-83d8-6e994b0f676b
Ancestors: Tools-mt.925
Fix DictionaryInspector to allow debugging of Dictionary initialization, and render the entries in order for OrderedDictionary's.
=============== Diff against Tools-mt.925 ===============
Item was changed:
----- Method: DictionaryInspector>>calculateKeyArray (in category 'selecting') -----
calculateKeyArray
+ "Recalculate the KeyArray from the object being inspected."
+ keyArray := [ object keysInOrder ] ifError:
+ [ "Can occur when debugging Dictionary new"
+ Array empty ].
+ selectionIndex := 0!
- "Recalculate the KeyArray from the object being inspected"
-
- keyArray := object keysSortedSafely asArray.
- selectionIndex := 0.
- !
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1291.mcz
==================== Summary ====================
Name: Kernel-nice.1291
Author: nice
Time: 26 December 2019, 6:56:30.382504 pm
UUID: ba77885c-3a21-4d74-a5a4-ef2c3572e192
Ancestors: Kernel-mt.1290
Make AssertionFailure an Error rather than a Halt.
This change is necessary for at least running the SUnit tests suite, otherwise the DecompilerTests hangs in a debugger...
There was a consensus on this decision in squeak-dev thread last november, so let's just do it:
[squeak-dev] Squeak's AssertionFailure vs. SUnit's TestFailure
http://lists.squeakfoundation.org/pipermail/squeak-dev/2019-November/205039…
For now, keep it resumable. I don't know if reasonable, but like that, AssertionFailure behavior should be mostly unchanged.
=============== Diff against Kernel-mt.1290 ===============
Item was changed:
+ Error subclass: #AssertionFailure
- Halt subclass: #AssertionFailure
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Kernel-Exceptions'!
!AssertionFailure commentStamp: 'gh 5/2/2002 20:29' prior: 0!
AsssertionFailure is the exception signaled from Object>>assert: when the assertion block evaluates to false.!
Item was added:
+ ----- Method: AssertionFailure>>isResumable (in category 'priv handling') -----
+ isResumable
+ ^ true!
Nicolas Cellier uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-nice.250.mcz
==================== Summary ====================
Name: Multilingual-nice.250
Author: nice
Time: 11 December 2019, 9:45:47.879387 pm
UUID: ebe6fac0-efa6-449b-8e4c-7eb3fd167b47
Ancestors: Multilingual-mt.249
Nuke keyValueIndex (my pleasure)
The intention was for accessing either event buffer at 3 (macRoman) or 6 (UTF32/UCS4)
Currently the choice is between 6 or 6 (it could have been dependent on VM version in 2007, but it's not and never was in Cog/Spur)
Anyway, the code was testing for presence of #SugarLaunche instead of #SugarLauncher, so it would not have worked as intended (if ever we can distinguish 6 from 6).
=============== Diff against Multilingual-mt.249 ===============
Item was changed:
KeyboardInputInterpreter subclass: #MacUnicodeInputInterpreter
+ instanceVariableNames: ''
- instanceVariableNames: 'keyValueIndex'
classVariableNames: ''
poolDictionaries: ''
category: 'Multilingual-TextConversion'!
Item was changed:
----- Method: MacUnicodeInputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----
nextCharFrom: sensor firstEvt: evtBuf
| keyValue mark |
keyValue := evtBuf at: 6.
mark := self japaneseSpecialMark: keyValue.
mark notNil
ifTrue: [^ mark].
- keyValue < 256
- ifTrue: [^Character value: keyValue].
"Smalltalk systemLanguage charsetClass charFromUnicode: keyValue."
^ Unicode value: keyValue!
Item was changed:
KeyboardInputInterpreter subclass: #UnixUnicodeInputInterpreter
+ instanceVariableNames: ''
- instanceVariableNames: 'keyValueIndex'
classVariableNames: ''
poolDictionaries: ''
category: 'Multilingual-TextConversion'!
Item was removed:
- ----- Method: UnixUnicodeInputInterpreter>>initialize (in category 'initialization') -----
- initialize
- | satisfiesVersion launcherClass |
- launcherClass := Smalltalk at: #SugarLaunche ifAbsent: [nil].
- satisfiesVersion := launcherClass notNil and: [launcherClass current isRunningInSugar].
- satisfiesVersion
- ifTrue: [keyValueIndex := 6]
- ifFalse: [keyValueIndex := 6 "it might have to be 3, but probably different logic to check the VM version would be better."]!
Item was removed:
- ----- Method: UnixUnicodeInputInterpreter>>keyValueIndex (in category 'accessing') -----
- keyValueIndex
- ^ keyValueIndex!
Item was changed:
----- Method: UnixUnicodeInputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----
nextCharFrom: sensor firstEvt: evtBuf
| keyValue mark |
+ keyValue := evtBuf at: 6.
- keyValue := evtBuf at: self keyValueIndex.
mark := self japaneseSpecialMark: keyValue.
mark notNil
ifTrue: [^ mark].
keyValue < 256
ifTrue: [^ Character value: keyValue].
"Smalltalk systemLanguage charsetClass charFromUnicode: keyValue."
^ Unicode value: keyValue!