A new version of Kernel was added to project The Inbox: http://source.squeak.org/inbox/Kernel-xw.1463.mcz
==================== Summary ====================
Name: Kernel-xw.1463 Author: xw Time: 4 May 2022, 9:00:19.605843 pm UUID: 03cc3269-c236-214d-a9e7-f7ee0c914b3d Ancestors: Kernel-nice.1462
Add Unicode support and simplify implementation of CompiledMethod>>#getPreambleFrom:at:
=============== Diff against Kernel-nice.1462 ===============
Item was changed: ----- Method: CompiledMethod>>getPreambleFrom:at: (in category 'source code management') ----- getPreambleFrom: aFileStream at: endPosition + | chunk | + aFileStream position: endPosition + 2. + [(chunk := aFileStream backChunk) beginsWith: ']lang['] whileTrue. + ^ chunk! - "This method is an ugly hack. This method assumes that source files have ASCII-compatible encoding and that preambles contain no non-ASCII characters." - - | chunkSize chunk | - chunkSize := 160 min: endPosition. - [ - | index | - chunk := aFileStream - position: (endPosition - chunkSize + 1 max: 0); - basicNext: chunkSize. - (index := chunk lastIndexOf: $!! startingAt: chunk size) ~= 0 ifTrue: [ - ^chunk copyFrom: index + 1 to: chunk size ]. - chunkSize := chunkSize * 2. - chunkSize <= endPosition ] whileTrue. - ^chunk!
Hi Xin!
Thanks. :-) Merged. Please add commentary to magic numbers such as "2" the next time.
Best, Marcel Am 04.05.2022 15:01:20 schrieb commits@source.squeak.org commits@source.squeak.org: A new version of Kernel was added to project The Inbox: http://source.squeak.org/inbox/Kernel-xw.1463.mcz
==================== Summary ====================
Name: Kernel-xw.1463 Author: xw Time: 4 May 2022, 9:00:19.605843 pm UUID: 03cc3269-c236-214d-a9e7-f7ee0c914b3d Ancestors: Kernel-nice.1462
Add Unicode support and simplify implementation of CompiledMethod>>#getPreambleFrom:at:
=============== Diff against Kernel-nice.1462 ===============
Item was changed: ----- Method: CompiledMethod>>getPreambleFrom:at: (in category 'source code management') ----- getPreambleFrom: aFileStream at: endPosition + | chunk | + aFileStream position: endPosition + 2. + [(chunk := aFileStream backChunk) beginsWith: ']lang['] whileTrue. + ^ chunk! - "This method is an ugly hack. This method assumes that source files have ASCII-compatible encoding and that preambles contain no non-ASCII characters." - - | chunkSize chunk | - chunkSize := 160 min: endPosition. - [ - | index | - chunk := aFileStream - position: (endPosition - chunkSize + 1 max: 0); - basicNext: chunkSize. - (index := chunk lastIndexOf: $!! startingAt: chunk size) ~= 0 ifTrue: [ - ^chunk copyFrom: index + 1 to: chunk size ]. - chunkSize := chunkSize * 2. - chunkSize - ^chunk!
squeak-dev@lists.squeakfoundation.org