[squeak-dev] The Trunk: Regex-Core-ct.82.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Oct 12 13:07:28 UTC 2022
Christoph Thiede uploaded a new version of Regex-Core to project The Trunk:
http://source.squeak.org/trunk/Regex-Core-ct.82.mcz
==================== Summary ====================
Name: Regex-Core-ct.82
Author: ct
Time: 12 October 2022, 3:07:26.700412 pm
UUID: 9854ef71-758d-6e44-8761-0fe1f5681198
Ancestors: Regex-Core-ct.81
Minor refactoring: In #syntaxLookaround:, only pass receiver like in other dispatch selectors. Slightly recategorizes RxmLink and RxsNode hierarchy and adds missing abstract #dispatchTo:. Removes unused private initialization selectors from RxsLookaround and RxsMessagePredicate. Renames RxsMessagePredicate>>#negated into #isNegated to avoid confusion with #negated implementation of RxsCharacter et al.
=============== Diff against Regex-Core-ct.81 ===============
Item was added:
+ ----- Method: RxMatchOptimizer>>syntaxLookaround: (in category 'double dispatch') -----
+ syntaxLookaround: lookaroundNode
+ "Do nothing."!
Item was removed:
- ----- Method: RxMatchOptimizer>>syntaxLookaround:forward:positive: (in category 'double dispatch') -----
- syntaxLookaround: lookaroundNode forward: forward positive: positive
- "Do nothing."!
Item was changed:
----- Method: RxMatchOptimizer>>syntaxMessagePredicate: (in category 'double dispatch') -----
syntaxMessagePredicate: messagePredicateNode
+ messagePredicateNode isNegated ifTrue: [
- messagePredicateNode negated ifTrue: [
^self addNonMethodPredicate: messagePredicateNode selector ].
self addMethodPredicate: messagePredicateNode selector!
Item was added:
+ ----- Method: RxMatcher>>syntaxLookaround: (in category 'double dispatch') -----
+ syntaxLookaround: lookaroundNode
+ "Double dispatch from the syntax tree.
+ Special link can handle lookarounds (look ahead and look behind, positive and negative)."
+ | piece |
+ piece := lookaroundNode piece dispatchTo: self.
+ piece terminateWith: RxmTerminator new. "see commment in RxmLookaround>>#terminateWith:"
+ ^ RxmLookaround
+ with: piece
+ forward: lookaroundNode forward
+ positive: lookaroundNode positive!
Item was removed:
- ----- Method: RxMatcher>>syntaxLookaround:forward:positive: (in category 'double dispatch') -----
- syntaxLookaround: lookaroundNode forward: forwardBoolean positive: positiveBoolean
- "Double dispatch from the syntax tree.
- Special link can handle lookarounds (look ahead and look behind, positive and negative)."
- | piece |
- piece := lookaroundNode piece dispatchTo: self.
- piece terminateWith: RxmTerminator new. "see commment in RxmLookaround>>#terminateWith:"
- ^ RxmLookaround with: piece forward: forwardBoolean positive: positiveBoolean!
Item was changed:
----- Method: RxMatcher>>syntaxMessagePredicate: (in category 'double dispatch') -----
syntaxMessagePredicate: messagePredicateNode
"Double dispatch from the syntax tree.
Special link can handle predicates."
+ ^messagePredicateNode isNegated
- ^messagePredicateNode negated
ifTrue: [RxmPredicate new bePerformNot: messagePredicateNode selector]
ifFalse: [RxmPredicate new bePerform: messagePredicateNode selector]!
Item was changed:
+ ----- Method: RxmLink>>printOn: (in category 'printing') -----
- ----- Method: RxmLink>>printOn: (in category 'as yet unclassified') -----
printOn: stream
super printOn: stream.
stream
nextPut: $(;
print: self identityHash;
nextPutAll: ', ';
print: (next ifNotNil: [ next identityHash ]);
nextPut: $)!
Item was changed:
----- Method: RxmLookaround>>terminateWith: (in category 'building') -----
terminateWith: aNode
"Documentation only. The inner lookaround piece is terminated separately during the construction of the receiver. Lookaround links may not receive #terminateWith: if they are located in a loopback branch, but the inner piece does *not* contain a path to the next link of the receiver."
+ ^super terminateWith: aNode!
- super terminateWith: aNode!
Item was changed:
+ ----- Method: RxsBranch>>dispatchTo: (in category 'building') -----
- ----- Method: RxsBranch>>dispatchTo: (in category 'accessing') -----
dispatchTo: aMatcher
"Inform the matcher of the kind of the node, and it
will do whatever it has to."
^aMatcher syntaxBranch: self!
Item was changed:
+ ----- Method: RxsCharSet>>dispatchTo: (in category 'building') -----
- ----- Method: RxsCharSet>>dispatchTo: (in category 'accessing') -----
dispatchTo: aMatcher
"Inform the matcher of the kind of the node, and it
will do whatever it has to."
^aMatcher syntaxCharSet: self!
Item was changed:
+ ----- Method: RxsCharSet>>enumerateTo: (in category 'building') -----
- ----- Method: RxsCharSet>>enumerateTo: (in category 'accessing') -----
enumerateTo: aSet
negated ifTrue: [^ self "Not enumerable"].
^ elements do: [:each | each enumerateTo: aSet]!
Item was changed:
+ ----- Method: RxsCharacter>>dispatchTo: (in category 'building') -----
- ----- Method: RxsCharacter>>dispatchTo: (in category 'accessing') -----
dispatchTo: aMatcher
"Inform the matcher of the kind of the node, and it
will do whatever it has to."
^aMatcher syntaxCharacter: self!
Item was changed:
+ ----- Method: RxsCharacter>>enumerateTo: (in category 'building') -----
- ----- Method: RxsCharacter>>enumerateTo: (in category 'accessing') -----
enumerateTo: aSet
^aSet add: character!
Item was changed:
+ ----- Method: RxsContextCondition>>dispatchTo: (in category 'building') -----
- ----- Method: RxsContextCondition>>dispatchTo: (in category 'accessing') -----
dispatchTo: aBuilder
^aBuilder perform: kind!
Item was removed:
- ----- Method: RxsLookaround>>beLookahead (in category 'initialize-release') -----
- beLookahead
- forward := true!
Item was removed:
- ----- Method: RxsLookaround>>beLookbehind (in category 'initialize-release') -----
- beLookbehind
- forward := false!
Item was removed:
- ----- Method: RxsLookaround>>beNegative (in category 'initialize-release') -----
- beNegative
- positive := false!
Item was removed:
- ----- Method: RxsLookaround>>bePositive (in category 'initialize-release') -----
- bePositive
- positive := true!
Item was changed:
+ ----- Method: RxsLookaround>>dispatchTo: (in category 'building') -----
- ----- Method: RxsLookaround>>dispatchTo: (in category 'accessing') -----
dispatchTo: aBuilder
"Inform the matcher of the kind of the node, and it will do whatever it has to."
+ ^aBuilder syntaxLookaround: self!
- ^aBuilder syntaxLookaround: self forward: self forward positive: self positive!
Item was changed:
----- Method: RxsLookaround>>initialize (in category 'initialize-release') -----
initialize
super initialize.
+ positive := true.!
- self bePositive.!
Item was changed:
+ ----- Method: RxsMessagePredicate>>dispatchTo: (in category 'building') -----
- ----- Method: RxsMessagePredicate>>dispatchTo: (in category 'accessing') -----
dispatchTo: aBuilder
"Inform the matcher of the kind of the node, and it
will do whatever it has to."
^aBuilder syntaxMessagePredicate: self!
Item was removed:
- ----- Method: RxsMessagePredicate>>initializeSelector: (in category 'initialize-release') -----
- initializeSelector: aSelector
- "The selector must be a one-argument message understood by Character."
-
- selector := aSelector!
Item was added:
+ ----- Method: RxsMessagePredicate>>isNegated (in category 'accessing') -----
+ isNegated
+
+ ^negated!
Item was removed:
- ----- Method: RxsMessagePredicate>>negated (in category 'accessing') -----
- negated
-
- ^negated!
Item was added:
+ ----- Method: RxsNode>>dispatchTo: (in category 'building') -----
+ dispatchTo: aMatcher
+ "Inform the matcher of the kind of the node, and it will do whatever it has to."
+
+ ^ self subclassResponsibility!
Item was changed:
+ ----- Method: RxsPiece>>dispatchTo: (in category 'building') -----
- ----- Method: RxsPiece>>dispatchTo: (in category 'accessing') -----
dispatchTo: aMatcher
"Inform the matcher of the kind of the node, and it
will do whatever it has to."
^aMatcher syntaxPiece: self!
Item was changed:
+ ----- Method: RxsPredicate>>dispatchTo: (in category 'building') -----
- ----- Method: RxsPredicate>>dispatchTo: (in category 'accessing') -----
dispatchTo: anObject
^anObject syntaxPredicate: self!
Item was changed:
+ ----- Method: RxsPredicate>>enumerateTo: (in category 'building') -----
- ----- Method: RxsPredicate>>enumerateTo: (in category 'accessing') -----
enumerateTo: aSet
^self "Not enumerable"!
Item was changed:
+ ----- Method: RxsPredicate>>negated (in category 'converting') -----
- ----- Method: RxsPredicate>>negated (in category 'accessing') -----
negated
^self copy negate!
Item was added:
+ ----- Method: RxsRange>>dispatchTo: (in category 'building') -----
+ dispatchTo: aMatcher
+ "To be wrapped into a RxsCharSet first."
+
+ ^self shouldNotImplement!
Item was changed:
+ ----- Method: RxsRange>>enumerateTo: (in category 'building') -----
- ----- Method: RxsRange>>enumerateTo: (in category 'accessing') -----
enumerateTo: aSet
"Add all of the elements I represent to the collection."
first asInteger to: last asInteger do: [ :charCode |
aSet add: charCode asCharacter ].
^self!
Item was changed:
+ ----- Method: RxsRegex>>beNonCapturing (in category 'initialize-release') -----
- ----- Method: RxsRegex>>beNonCapturing (in category 'accessing') -----
beNonCapturing
isCapturing := false.!
Item was changed:
+ ----- Method: RxsRegex>>dispatchTo: (in category 'building') -----
- ----- Method: RxsRegex>>dispatchTo: (in category 'accessing') -----
dispatchTo: aMatcher
"Inform the matcher of the kind of the node, and it
will do whatever it has to."
^aMatcher syntaxRegex: self!
More information about the Squeak-dev
mailing list
|