<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>Thank you for reviewing and merging this all, Nicolas!</p>
<p><br>
</p>
<p>Actually, these versions were still WIP as noted in <a href="http://forum.world.st/The-Inbox-Regex-Core-ct-56-mcz-td5113011.html" class="x_OWAAutoLink">
the inbox thread</a>.</p>
<p>Didn't you notice this or did you rate it as non-critical? :)</p>
<p>However, I guess it's not a big problem because this is not a regression.</p>
<p><br>
</p>
<p>Will fix the open bugs ASAP (but unfortunately, it may take me some weeks to find the time ...)!</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</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> Freitag, 8. Mai 2020 22:24:45<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Regex-Core-ct.55.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Nicolas Cellier uploaded a new version of Regex-Core to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Regex-Core-ct.55.mcz">http://source.squeak.org/trunk/Regex-Core-ct.55.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Regex-Core-ct.55<br>
Author: ct<br>
Time: 6 March 2020, 7:08:55.997601 pm<br>
UUID: 4f76095b-f67f-4c41-afec-d936b7dfeecb<br>
Ancestors: Regex-Core-eem.54<br>
<br>
Implements positive lookaheads in Regular Expressions for Squeak<br>
<br>
There were already some stubs and a bit of documentation, but while negative lookaheads (such as 'q(?!u)' asRegex) have been working in the past, positive lookaheads (such as 'q(?=u)' asRegex) never worked before.<br>
<br>
- Fix erroneous parsing of positive lookahead syntax (the previous implementation missed a side effect of #regex)<br>
- Add #positive argument to construction messages for lookahead nodes/links (see RxsLookaround >> #dispatchTo: and others, these steps had actually been forgotten)*<br>
- In RxMatcher >> #matchAgainstLookahead:positive:nextLink:, actually respect the #positive argument<br>
- Fix typos in documentation and category names<br>
<br>
*Note: I decided to remove but not deprecate the original construction messages for lookahead nodes/links. The cause is that IMO, the default value should never be a negative setting, which you would not expect at first glance. Also, all the link and node classes
 are rather an implementation detail of Regex-Core, so I think we do not need to move these methods into the Deprecated package. Please let me know if you agree with this.<br>
<br>
Please review! Further information about lookaheads can be found here: <a href="https://www.regular-expressions.info/lookaround.html">
https://www.regular-expressions.info/lookaround.html</a><br>
<br>
=============== Diff against Regex-Core-eem.54 ===============<br>
<br>
Item was removed:<br>
- ----- Method: RxMatchOptimizer>>syntaxLookaround: (in category 'double dispatch') -----<br>
- syntaxLookaround: lookaroundNode <br>
-        "Do nothing."!<br>
<br>
Item was added:<br>
+ ----- Method: RxMatchOptimizer>>syntaxLookaround:positive: (in category 'double dispatch') -----<br>
+ syntaxLookaround: lookaroundNode positive: positive<br>
+        "Do nothing."!<br>
<br>
Item was removed:<br>
- ----- Method: RxMatcher>>matchAgainstLookahead:nextLink: (in category 'matching') -----<br>
- matchAgainstLookahead: lookahead nextLink: anRmxLink<br>
- <br>
-        | position result |<br>
-        position := stream position.<br>
-        result := lookahead matchAgainst: self.<br>
-        stream position: position.<br>
-        result ifTrue: [ ^false ].<br>
-        ^anRmxLink matchAgainst: self!<br>
<br>
Item was added:<br>
+ ----- Method: RxMatcher>>matchAgainstLookahead:positive:nextLink: (in category 'matching') -----<br>
+ matchAgainstLookahead: lookahead positive: positive nextLink: anRmxLink<br>
+ <br>
+        | position result |<br>
+        position := stream position.<br>
+        result := lookahead matchAgainst: self.<br>
+        stream position: position.<br>
+        ^ result = positive and: [<br>
+                anRmxLink matchAgainst: self]!<br>
<br>
Item was removed:<br>
- ----- Method: RxMatcher>>syntaxLookaround: (in category 'double dispatch') -----<br>
- syntaxLookaround: lookaroundNode<br>
-        "Double dispatch from the syntax tree. <br>
-        Special link can handle lookarounds (look ahead, positive and negative)."<br>
-        | piece |<br>
-        piece := lookaroundNode piece dispatchTo: self.<br>
-        ^ RxmLookahead with: piece!<br>
<br>
Item was added:<br>
+ ----- Method: RxMatcher>>syntaxLookaround:positive: (in category 'double dispatch') -----<br>
+ syntaxLookaround: lookaroundNode positive: positiveBoolean<br>
+        "Double dispatch from the syntax tree.<br>
+        Special link can handle lookarounds (look ahead, positive and negative)."<br>
+        | piece |<br>
+        piece := lookaroundNode piece dispatchTo: self.<br>
+        ^ RxmLookahead with: piece positive: positiveBoolean!<br>
<br>
Item was changed:<br>
  ----- Method: RxParser>>lookAround (in category 'recursive descent') -----<br>
  lookAround<br>
+        "Parse a lookaround expression after: (?<lookaround>) <br>
+        <lookaround> ::= !!<regex> | =<regex>"<br>
+        | positive |<br>
+        ('!!=' includes: lookahead) ifFalse: [<br>
+                ^ self signalParseError: 'Invalid lookaround expression ?', lookahead asString].<br>
+        positive := lookahead == $=.<br>
-        "Parse a lookaround expression after: (?<lookround>) <br>
-        <lookround> ::= !!<regex> | =<regex>"<br>
-        | lookaround |<br>
-        (lookahead == $!!<br>
-        or: [ lookahead == $=])<br>
-                ifFalse: [ ^ self signalParseError: 'Invalid lookaround expression ?', lookahead asString ].<br>
         self next.<br>
+        ^ RxsLookaround<br>
+                with: self regex<br>
+                positive: positive!<br>
-        lookaround := RxsLookaround with: self regex.<br>
-        lookahead == $!!<br>
-                ifTrue: [ lookaround beNegative ].<br>
-        ^ lookaround<br>
-        !<br>
<br>
Item was changed:<br>
  RxmLink subclass: #RxmLookahead<br>
+        instanceVariableNames: 'lookahead positive'<br>
-        instanceVariableNames: 'lookahead'<br>
         classVariableNames: ''<br>
         poolDictionaries: ''<br>
         category: 'Regex-Core'!<br>
  <br>
+ !RxmLookahead commentStamp: 'ct 3/6/2020 18:29' prior: 0!<br>
+ Instance holds onto a lookahead which matches but does not consume anything.<br>
- !RxmLookahead commentStamp: '<historical>' prior: 0!<br>
- Instance holds onto a lookead which matches but does not consume anything.<br>
  <br>
+ Instance Variables<br>
+        lookahead:              <RxmLink><br>
+        positive:               <Boolean><br>
+ !<br>
- Instance variables:<br>
-        predicate               <RxmLink>!<br>
<br>
Item was removed:<br>
- ----- Method: RxmLookahead class>>with: (in category 'instance creation') -----<br>
- with: aPiece<br>
- <br>
-        ^self new lookahead: aPiece!<br>
<br>
Item was added:<br>
+ ----- Method: RxmLookahead class>>with:positive: (in category 'instance creation') -----<br>
+ with: aPiece positive: aBoolean<br>
+ <br>
+        ^self new lookahead: aPiece positive: aBoolean!<br>
<br>
Item was removed:<br>
- ----- Method: RxmLookahead>>lookahead: (in category 'accessing') -----<br>
- lookahead: anRxmLink<br>
-        lookahead := anRxmLink!<br>
<br>
Item was added:<br>
+ ----- Method: RxmLookahead>>lookahead:positive: (in category 'accessing') -----<br>
+ lookahead: anRxmLink positive: aBoolean<br>
+        lookahead := anRxmLink.<br>
+        positive := aBoolean.!<br>
<br>
Item was changed:<br>
  ----- Method: RxmLookahead>>matchAgainst: (in category 'matching') -----<br>
  matchAgainst: aMatcher<br>
         "Match if the predicate block evaluates to true when given the<br>
         current stream character as the argument."<br>
  <br>
+        ^aMatcher matchAgainstLookahead: lookahead positive: positive nextLink: next!<br>
-        ^aMatcher matchAgainstLookahead: lookahead nextLink: next!<br>
<br>
Item was removed:<br>
- ----- Method: RxsLookaround class>>with: (in category 'instance creation') -----<br>
- with: anRsxPiece<br>
-        ^ self new<br>
-                initializePiece: anRsxPiece!<br>
<br>
Item was added:<br>
+ ----- Method: RxsLookaround class>>with:positive: (in category 'instance creation') -----<br>
+ with: aRxsRegex positive: positiveBoolean<br>
+        ^ self new<br>
+                initializePiece: aRxsRegex<br>
+                positive: positiveBoolean!<br>
<br>
Item was changed:<br>
+ ----- Method: RxsLookaround>>beNegative (in category 'initialize-release') -----<br>
- ----- Method: RxsLookaround>>beNegative (in category 'initailize-release') -----<br>
  beNegative<br>
         positive := false!<br>
<br>
Item was changed:<br>
+ ----- Method: RxsLookaround>>bePositive (in category 'initialize-release') -----<br>
- ----- Method: RxsLookaround>>bePositive (in category 'initailize-release') -----<br>
  bePositive<br>
         positive := true!<br>
<br>
Item was changed:<br>
  ----- Method: RxsLookaround>>dispatchTo: (in category 'accessing') -----<br>
  dispatchTo: aBuilder<br>
+        "Inform the matcher of the kind of the node, and it will do whatever it has to."<br>
+        ^aBuilder syntaxLookaround: self positive: self positive!<br>
-        "Inform the matcher of the kind of the node, and it<br>
-        will do whatever it has to."<br>
-        ^aBuilder syntaxLookaround: self!<br>
<br>
Item was added:<br>
+ ----- Method: RxsLookaround>>initialize (in category 'initialize-release') -----<br>
+ initialize<br>
+ <br>
+        super initialize.<br>
+        self bePositive.!<br>
<br>
Item was removed:<br>
- ----- Method: RxsLookaround>>initializePiece: (in category 'initailize-release') -----<br>
- initializePiece: anRsxPiece<br>
-        super initialize.<br>
-        piece := anRsxPiece.!<br>
<br>
Item was added:<br>
+ ----- Method: RxsLookaround>>initializePiece:positive: (in category 'initialize-release') -----<br>
+ initializePiece: anRsxPiece positive: positiveBoolean<br>
+ <br>
+        piece := anRsxPiece.<br>
+        positive := positiveBoolean.!<br>
<br>
Item was added:<br>
+ ----- Method: RxsLookaround>>positive (in category 'accessing') -----<br>
+ positive<br>
+ <br>
+        ^ positive!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>