[Pkg] The Trunk: Regex-Core-pre.51.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu May 19 18:49:12 UTC 2016
Patrick Rein uploaded a new version of Regex-Core to project The Trunk:
http://source.squeak.org/trunk/Regex-Core-pre.51.mcz
==================== Summary ====================
Name: Regex-Core-pre.51
Author: pre
Time: 19 May 2016, 8:49:05.994548 pm
UUID: 49e3e29a-cf96-4f42-a8f1-4af75dbb9bca
Ancestors: Regex-Core-ul.50
Fixes an erroring test of RxMatcher by replacing a copy with a veryDeepCopy to sustain the integrity of the RxmLink tree.
=============== Diff against Regex-Core-ul.50 ===============
Item was changed:
----- Method: RxMatcher>>makeQuantified:min:max: (in category 'private') -----
makeQuantified: anRxmLink min: min max: max
"Perform recursive poor-man's transformation of the {<min>,<max>} quantifiers."
| aMatcher |
"<atom>{,<max>} ==> (<atom>{1,<max>})?"
min = 0 ifTrue: [
^ self makeOptional: (self makeQuantified: anRxmLink min: 1 max: max) ].
"<atom>{<min>,} ==> <atom>{<min>-1, <min>-1}<atom>+"
max ifNil: [
+ ^ (self makeQuantified: anRxmLink min: 1 max: min-1) pointTailTo: (self makePlus: anRxmLink veryDeepCopy) ].
- ^ (self makeQuantified: anRxmLink min: 1 max: min-1) pointTailTo: (self makePlus: anRxmLink copy) ].
"<atom>{<max>,<max>} ==> <atom><atom> ... <atom>"
min = max
ifTrue: [
+ aMatcher := anRxmLink veryDeepCopy.
+ (min-1) timesRepeat: [ aMatcher pointTailTo: anRxmLink veryDeepCopy ].
- aMatcher := anRxmLink copy.
- (min-1) timesRepeat: [ aMatcher pointTailTo: anRxmLink copy ].
^ aMatcher ].
"<atom>{<min>,<max>} ==> <atom>{<min>,<min>}(<atom>{1,<max>-1})?"
+ aMatcher := self makeOptional: anRxmLink veryDeepCopy.
- aMatcher := self makeOptional: anRxmLink copy.
(max - min - 1) timesRepeat: [
+ aMatcher := self makeOptional: (anRxmLink veryDeepCopy pointTailTo: aMatcher) ].
- aMatcher := self makeOptional: (anRxmLink copy pointTailTo: aMatcher) ].
^ (self makeQuantified: anRxmLink min: min max: min) pointTailTo: aMatcher!
More information about the Packages
mailing list