Christoph Thiede uploaded a new version of Regex-Core to project The Trunk:
http://source.squeak.org/trunk/Regex-Core-ct.89.mcz
==================== Summary ====================
Name: Regex-Core-ct.89
Author: ct
Time: 1 May 2024, 6:10:49.419117 pm
UUID: d2c4145b-80ff-4c4f-baa6-7fcd9f929a42
Ancestors: Regex-Core-ct.87
Fixes and documents order of keyed subexpressions to be top-down and left-to-right (complements Regex-Tests-Core-ct.36). Documents index offset in positional #subexpression: and #subexpressions:.
=============== Diff against Regex-Core-ct.87 ===============
Item was changed:
----- Method: RxMatcher>>keyedSubexpressionRanges: (in category 'accessing') -----
keyedSubexpressionRanges: key
+ "Answer an array of all match ranges (inclusiveStart -> inclusiveStop) of the subexpression at the given key. If a key is defined in multiple groups, sort ranges top-down and left-to-right."
- "Answer an array of all match ranges (inclusiveStart -> inclusiveStop) of the subexpression at the given key."
^ ((keyedMarkerPositions at: key) gather: [:pair |
(markerPositions at: pair first)
with: (markerPositions at: pair second)
collect: [:start :stop | start + 1 to: stop]])
"Since the same key can be defined for multiple markers, ordering the matches is non-trivial."
+ reverse sort: [:range | range start] ascending!
- sort: [:range | range stop] ascending!
Item was changed:
----- Method: RxMatcher>>subexpression: (in category 'accessing') -----
subexpression: subIndex
"Answer a string that matched the subexpression at the given index.
If there are multiple matches, answer the last one.
If there are no matches, answer nil.
+ NB: index 1 is the entire match, index 2 is the first capture group, etc.
(NB: it used to answer an empty string but I think nil makes more sense)."
^ (self subexpressions: subIndex)
ifNotEmpty: [:expressions | expressions last]
ifEmpty: [nil]!
Item was changed:
----- Method: RxMatcher>>subexpressions: (in category 'accessing') -----
subexpressions: subIndex
"Answer an array of all matches of the subexpression at the given index.
+ The answer is always an array; it is empty if there are no matches.
+ NB: index 1 is the entire match, index 2 is the first capture group, etc."
- The answer is always an array; it is empty if there are no matches."
| originalPosition startPositions stopPositions reply |
originalPosition := stream position.
startPositions := self subBeginning: subIndex.
stopPositions := self subEnd: subIndex.
(startPositions isEmpty or: [stopPositions isEmpty]) ifTrue: [^Array new].
reply := Array new: startPositions size.
1 to: reply size do: [ :index |
| start stop |
start := startPositions at: index.
stop := stopPositions at: index.
stream position: start.
reply at: index put: (stream next: stop - start) ].
stream position: originalPosition.
^reply!
Chris Muller uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-cmm.146.mcz
==================== Summary ====================
Name: SUnit-cmm.146
Author: cmm
Time: 30 April 2024, 12:43:19.759559 am
UUID: 51424d55-94d0-4d2e-b8dc-f470b05cb44d
Ancestors: SUnit-mt.145
Let SUnit provide consistent results when running vs. debugging, rather than quietly hiding SUnit timeout configuration bugs when debugging.
=============== Diff against SUnit-mt.145 ===============
Item was changed:
----- Method: TestCase>>debug (in category 'running') -----
debug
"Run the receiver and open a debugger on the first failure or error."
+ ^ self assureResourcesDuring: [self runCase]!
- ^ self assureResourcesDuring: [self runCaseWithoutTimeout]!
Item was changed:
----- Method: TestCase>>debugAsFailure (in category 'running') -----
debugAsFailure
"Spawn a debugger that is ready to debug the receiver."
(Process
forBlock: [self debug]
runUntil: [:context | context isClosureContext "navigate the process directly to the point where it is about to send #setUp"
+ and: [context selector = #runCase]])
- and: [context selector = #runCaseWithoutTimeout]])
debug.!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1251.mcz
==================== Summary ====================
Name: Tools-eem.1251
Author: eem
Time: 29 April 2024, 2:53:17.573251 pm
UUID: f493712c-4f55-4c9e-96f9-394e45e29b32
Ancestors: Tools-eem.1250
For the TreeBrowser, if a system category is already selected, use it as teh stem of the prompt to add a new category, so that it is easier to add a subcategory.
Guard against empty categories in answering the class list of a PackagePaneBrowser.
=============== Diff against Tools-eem.1250 ===============
Item was changed:
----- Method: Browser>>addSystemCategory (in category 'system category functions') -----
addSystemCategory
"Prompt for a new category name and add it before the
current selection, or at the end if no current selection"
| oldSelection newName |
self okToChange ifFalse: [^ self].
oldSelection := self selectedSystemCategory.
newName := self
request: 'Please type new category name'
+ initialAnswer: (oldSelection ifNil: ['Category-Name'] ifNotNil: [oldSelection, '-Name']).
+ newName isEmpty ifTrue: [^ self].
- initialAnswer: 'Category-Name'.
- newName isEmpty
- ifTrue: [^ self]
- ifFalse: [newName := newName asSymbol].
systemOrganizer
+ addCategory: (newName := newName asSymbol)
- addCategory: newName
before: self selectedSystemCategory.
+ self selectSystemCategory: newName.
- self selectSystemCategory:
- (oldSelection isNil
- ifTrue: [ self systemCategoryList last ]
- ifFalse: [ oldSelection ]).
self changed: #systemCategoryList.!
Item was changed:
----- Method: PackagePaneBrowser>>classList (in category 'class list') -----
classList
self hasSystemCategorySelected ifTrue:
[| thisPackage thisCatSufix categories |
thisPackage := self package.
thisCatSufix := self selectedSystemCategoryWithoutPackage.
categories := systemOrganizer categories select: [:eachCat |
eachCat size >= thisPackage size
and: ["package prefix may occur in different cases, because they are assembled in the same package"
((eachCat first: thisPackage size) compare: thisPackage caseSensitive: false) = 2]
and: ["rest of system category must have exact case, because it is discrimnated by the system category list"
(eachCat allButFirst: thisPackage size) = thisCatSufix]].
+ categories ifNotEmpty:
+ [^categories gather: [:eachCat | systemOrganizer listAtCategoryNamed: eachCat]]].
- ^ categories gather: [:eachCat |
- systemOrganizer listAtCategoryNamed: eachCat]].
self hasPackageSelected ifTrue:
[^ self packageClasses].
^ systemOrganizer allElements!
Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-mt.232.mcz
==================== Summary ====================
Name: FFI-Kernel-mt.232
Author: mt
Time: 17 April 2024, 11:17:11.319706 am
UUID: 7bf5313f-0238-2541-97d4-daeeadc57839
Ancestors: FFI-Kernel-mt.231
For communicating failed FFI callouts, add support for PrimitiveError and ExceptionInFFICallError.
=============== Diff against FFI-Kernel-mt.231 ===============
Item was changed:
----- Method: ExternalFunction class>>externalCallFailedWith: (in category 'error handling') -----
externalCallFailedWith: primErrorCode
"Raise an error after a failed call to an external function.
The primFailCode could be any of:
- a symbol; one of the standard primitive errors defined in Smalltalk primitiveErrorTable
- nil; the VM does not support primitive errors and is not providing error codes
- an integer; one of the FFI codes incremented by Smalltalk primitiveErrorTable size + 2
+ so as not to clash with the standard primitive errors
+ - an instance of PrimitiveError that encodes an FFI marshalling error
+ - an instance of PrimitiveError that encodes an FFI callout exception error."
+
+ primErrorCode isExceptionInFFICallError ifTrue:
+ [^self error: primErrorCode errorName, ' (', primErrorCode pc asString, ')'].
+ primErrorCode isPrimitiveError ifTrue:
+ [^self error: primErrorCode errorName, ' (', (self errorMessageFor: primErrorCode errorCode), ')'].
+
- so as not to clash with the standard primitive errors."
^self error: (primErrorCode isInteger
ifTrue: [self errorMessageFor: primErrorCode - (Smalltalk primitiveErrorTable size + 2)]
ifFalse: [primErrorCode isNil
ifTrue: ['Call to external function failed']
ifFalse: [primErrorCode]])!
Item was added:
+ ----- Method: Object>>externalCallFailedWith: (in category '*FFI-Kernel') -----
+ externalCallFailedWith: primErrorCode
+
+ ^ ExternalFunction externalCallFailedWith: primErrorCode!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1453.mcz
==================== Summary ====================
Name: System-mt.1453
Author: mt
Time: 17 April 2024, 10:43:17.752706 am
UUID: d5ecd791-4890-e748-950c-809da8376186
Ancestors: System-mt.1452
For structured primitive errors, expose #errorName in its print-string to make the error table more readable (see index 52 in #specialObjectsArray).
While ExceptionInFFICallError has both a custom name and an extra slot, you can use any custom instance of PrimitiveError to pass scoped error codes from failing primitives such as the existing #'operating system error' and its platform-specific error codes. However, you would need to reserve a new index in the error table and thus update the special-objects array. Therefore, custom VM plugins might want to choose an extra interface to communicate failed operations.
For example, SqueakFFI uses #getLastError and #externalCallFailed to fabricate readable error messages. Not sure why we do it this way (see #ffiFail: in plugin code) ... the approach via PrimitiveError seems more elegant to me... and via PrimErrFFIMarshallingError there is even a way to use the new scheme. :-)
=============== Diff against System-mt.1452 ===============
Item was added:
+ ----- Method: PrimitiveError>>printOn: (in category 'printing') -----
+ printOn: aStream
+
+ self errorName
+ ifNil: [super printOn: aStream]
+ ifNotNil: [:nm | nm printOn: aStream].!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1453.mcz
==================== Summary ====================
Name: System-mt.1453
Author: mt
Time: 17 April 2024, 10:43:17.752706 am
UUID: d5ecd791-4890-e748-950c-809da8376186
Ancestors: System-mt.1452
For structured primitive errors, expose #errorName in its print-string to make the error table more readable (see index 52 in #specialObjectsArray).
While ExceptionInFFICallError has both a custom name and an extra slot, you can use any custom instance of PrimitiveError to pass scoped error codes from failing primitives such as the existing #'operating system error' and its platform-specific error codes. However, you would need to reserve a new index in the error table and thus update the special-objects array. Therefore, custom VM plugins might want to choose an extra interface to communicate failed operations.
For example, SqueakFFI uses #getLastError and #externalCallFailed to fabricate readable error messages. Not sure why we do it this way (see #ffiFail: in plugin code) ... the approach via PrimitiveError seems more elegant to me... and via PrimErrFFIMarshallingError there is even a way to use the new scheme. :-)
=============== Diff against System-mt.1452 ===============
Item was added:
+ ----- Method: PrimitiveError>>printOn: (in category 'printing') -----
+ printOn: aStream
+
+ self errorName
+ ifNil: [super printOn: aStream]
+ ifNotNil: [:nm | nm printOn: aStream].!