[squeak-dev] The Trunk: Regex-Core-ct.76.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 5 18:05:29 UTC 2022


Christoph Thiede uploaded a new version of Regex-Core to project The Trunk:
http://source.squeak.org/trunk/Regex-Core-ct.76.mcz

==================== Summary ====================

Name: Regex-Core-ct.76
Author: ct
Time: 9 January 2022, 3:50:10.798554 am
UUID: 208ca41a-b09d-854e-b53e-83e0f004f0b4
Ancestors: Regex-Core-mt.61

Eliminates a shadowed variable warning. I have searched the entire package and did not find any other one.

=============== Diff against Regex-Core-mt.61 ===============

Item was changed:
  ----- Method: RxMatcher>>syntaxBranch: (in category 'double dispatch') -----
  syntaxBranch: branchNode
  	"Double dispatch from the syntax tree. 
  	Branch node is a link in a chain of concatenated pieces.
  	First build the matcher for the rest of the chain, then make 
  	it for the current piece and hook the rest to it."
  
  	| piece branch |
  	piece := branchNode piece.
  	branch := branchNode branch ifNil: [ ^piece dispatchTo: self ].
  	"Optimization: glue a sequence of individual characters into a single string to match."
  	piece isAtomic ifTrue: [
+ 		| result next resultStream |
+ 		resultStream := (String new: 40) writeStream.
+ 		next := branchNode tryMergingInto: resultStream.
+ 		result := resultStream contents.
- 		| result next stream |
- 		stream := (String new: 40) writeStream.
- 		next := branchNode tryMergingInto: stream.
- 		result := stream contents.
  		result size > 1 ifTrue: [
  			"worth merging"
  			^(RxmSubstring new substring: result ignoreCase: ignoreCase)
  				pointTailTo: (next ifNotNil: [ next dispatchTo: self ]);
  				yourself ] ].
  	"No optimization possible or worth it, just concatenate all. "
  	^(piece dispatchTo: self)
  		pointTailTo: (branch dispatchTo: self);
  		yourself!



More information about the Squeak-dev mailing list