<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>As this version relates to minor refactoring already: Would there be any objections if I removed the license information from the class comments of the Regex package, or at least moved these notes to the bottom of the class comments? IMHO it pretty much leads
 the functionality of the annotation bar in code holder ad absurdum if you only can see that boring license text there:</p>
<p><br>
</p>
<p><img size="4203" id="x_img280272" tabindex="0" style="max-width:99.9%" src="cid:338c462d-e72b-49d7-a160-5f645a53bd07"><br>
</p>
<p><br>
</p>
<p>This way it would read so much better:</p>
<p><br>
</p>
<p><img size="25751" id="x_img134695" tabindex="0" style="max-width:99.9%" src="cid:59e25afa-0db2-4fbe-b678-13480f8e69ab"><br>
</p>
<p><br>
</p>
<p>I do not want to disregard Vassili's awesome work on this package. But we already see his name in the annotation bar of every original method and to be honest, I would prefer the package to read like Smalltalk code rather than like a legal text. :-)</p>
<p><br>
</p>
<p><img size="4643" id="x_img632013" tabindex="0" style="max-width:99.9%" src="cid:9bee9fce-0d4c-4689-a573-83756209dad4"><br>
</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Montag, 23. August 2021 19:05:42<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Inbox: Regex-Core-ct.66.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">A new version of Regex-Core was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Regex-Core-ct.66.mcz">http://source.squeak.org/inbox/Regex-Core-ct.66.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Regex-Core-ct.66<br>
Author: ct<br>
Time: 23 August 2021, 7:05:38.221768 pm<br>
UUID: 3ede3098-6d93-0049-bd36-5dd0461903d2<br>
Ancestors: Regex-Core-mt.61<br>
<br>
Adds convenience selectors for accessing subexpressions (#allSubexpressions and #subexpressionRanges:). The other changes contain some minor refactorings only.<br>
<br>
=============== Diff against Regex-Core-mt.61 ===============<br>
<br>
Item was added:<br>
+ ----- Method: RxMatcher>>allSubexpressions (in category 'accessing') -----<br>
+ allSubexpressions<br>
+ <br>
+        ^ (1 to: self subexpressionCount) collect: [:index |<br>
+                self subexpressions: index]!<br>
<br>
Item was changed:<br>
  ----- Method: RxMatcher>>hookBranchOf:onto: (in category 'private') -----<br>
  hookBranchOf: regexNode onto: endMarker<br>
+        "Private - Recurse down the chain of regexes starting at regexNode, compiling their branches and hooking their tails to the endMarker node."<br>
-        "Private - Recurse down the chain of regexes starting at<br>
-        regexNode, compiling their branches and hooking their tails <br>
-        to the endMarker node."<br>
  <br>
+        | next rest |<br>
+        next := (regexNode branch dispatchTo: self)<br>
+                pointTailTo: endMarker; <br>
+                yourself.<br>
+        regexNode regex ifNil: [<br>
+                "Avoid creating a branch without an alternative."<br>
+                ^ next].<br>
+        <br>
+        rest := self hookBranchOf: regexNode regex onto: endMarker.<br>
+        ^ RxmBranch new<br>
+                next: next;<br>
+                alternative: rest;<br>
+                yourself!<br>
-        ^regexNode regex <br>
-                ifNil: [ "Avoid creating a branch without an alternative."<br>
-                        ^(regexNode branch dispatchTo: self)<br>
-                                pointTailTo: endMarker; <br>
-                                yourself ]<br>
-                ifNotNil: [ :regex |<br>
-                        | rest |<br>
-                        rest := self hookBranchOf: regex onto: endMarker.<br>
-                        ^RxmBranch new<br>
-                                next: ((regexNode branch dispatchTo: self)<br>
-                                        pointTailTo: endMarker; <br>
-                                        yourself);<br>
-                                alternative: rest;<br>
-                                yourself ]<br>
- !<br>
<br>
Item was changed:<br>
  ----- Method: RxMatcher>>subBeginning: (in category 'accessing') -----<br>
  subBeginning: subIndex<br>
  <br>
         subIndex = 1 ifTrue: [<br>
+                "beginning of root node"<br>
+                ^ (markerPositions at: 1)<br>
+                        ifNil: [#()]<br>
+                        ifNotNil: [:mp | {mp}] ].<br>
+        <br>
+        ^ markerPositions at: subIndex * 2 - 1!<br>
-                (markerPositions at: 1)<br>
-                        ifNil: [ ^#()]<br>
-                        ifNotNil: [ :mp | ^{ mp } ] ].<br>
-        ^markerPositions at: subIndex * 2 - 1!<br>
<br>
Item was changed:<br>
  ----- Method: RxMatcher>>subEnd: (in category 'accessing') -----<br>
  subEnd: subIndex<br>
  <br>
         subIndex = 1 ifTrue: [<br>
+                "end of root node"<br>
+                ^ (markerPositions at: 2)<br>
+                        ifNil: [#()]<br>
+                        ifNotNil: [:mp | {mp}] ].<br>
+        <br>
+        ^ markerPositions at: subIndex * 2!<br>
-                (markerPositions at: 2)<br>
-                        ifNil: [ ^#()]<br>
-                        ifNotNil: [ :mp | ^{ mp } ] ].<br>
-        ^markerPositions at: subIndex * 2!<br>
<br>
Item was changed:<br>
  ----- Method: RxMatcher>>subexpression: (in category 'accessing') -----<br>
  subexpression: subIndex<br>
         "Answer a string that matched the subexpression at the given index.<br>
         If there are multiple matches, answer the last one.<br>
         If there are no matches, answer nil. <br>
         (NB: it used to answer an empty string but I think nil makes more sense)."<br>
  <br>
+        ^ (self subexpressions: subIndex)<br>
+                ifNotEmpty: [:expressions | expressions last]<br>
+                ifEmpty: [nil]!<br>
-        | matches |<br>
-        matches := self subexpressions: subIndex.<br>
-        ^matches isEmpty ifTrue: [nil] ifFalse: [matches last]!<br>
<br>
Item was added:<br>
+ ----- Method: RxMatcher>>subexpressionRanges: (in category 'accessing') -----<br>
+ subexpressionRanges: subIndex<br>
+        "Answer an array of all match ranges of the subexpression at the given index."<br>
+ <br>
+        ^ (self subBeginning: subIndex)<br>
+                with: (self subEnd: subIndex)<br>
+                collect: [:start :stop | start to: stop - 1]!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>