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

commits at source.squeak.org commits at source.squeak.org
Thu Jul 14 14:15:49 UTC 2022

A new version of Regex-Core was added to project The Inbox:

==================== 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);

More information about the Squeak-dev mailing list