<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>Hi Tom,</p>
<p><br>
</p>
<p>this looks similar to <span>Regex-Core-ct.68. :-) I will compare both patches later in-depth, maybe we can merge the best of both approaches.</span></p>
<p><span><br>
</span></p>
<p><span>(For the future, maybe someone should build a tiny tool that automatically warns you when you start editing a class/protocol/method for that there already open patches in The Inbox ... :D)</span></p>
<p><span><br>
</span></p>
<p><span>Best,</span></p>
<p><span>Christoph</span></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, 18. Oktober 2021 12:55:02<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Inbox: Regex-Core-tobe.62.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-tobe.62.mcz">http://source.squeak.org/inbox/Regex-Core-tobe.62.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Regex-Core-tobe.62<br>
Author: tobe<br>
Time: 18 October 2021, 12:55:00.939602 pm<br>
UUID: 02286bc7-4450-4843-9988-40b1dc9bfa70<br>
Ancestors: Regex-Core-mt.61<br>
<br>
Add support for \uXXXX for specifying unicode code points<br>
<br>
=============== Diff against Regex-Core-mt.61 ===============<br>
<br>
Item was changed:<br>
  ----- Method: RxCharSetParser>>parseEscapeChar (in category 'parsing') -----<br>
  parseEscapeChar<br>
  <br>
+        | first last |<br>
-        | first |<br>
         self match: $\.<br>
         first := (RxsPredicate forEscapedLetter: lookahead)<br>
+                ifNil: [<br>
+                         (lookahead = $u and: [RxsPredicate matchesUnicodeSymbol: (source peek: 4)])<br>
+                                ifTrue: [RxsCharacter with: (RxsPredicate unicodeCharacterFrom: self)]<br>
+                                ifFalse: [RxsCharacter with: lookahead]].<br>
-                ifNil: [ RxsCharacter with: lookahead ].<br>
         self next == $- ifFalse: [^ elements add: first].<br>
         self next ifNil: [<br>
                 elements add: first.<br>
                 ^ self addChar: $-].<br>
+        last := lookahead = $\<br>
+                ifTrue: [<br>
+                        self next.<br>
+                        (RxsPredicate forEscapedLetter: lookahead)<br>
+                                ifNil: [<br>
+                                         (lookahead = $u and: [RxsPredicate matchesUnicodeSymbol: (source peek: 4)])<br>
+                                                ifTrue: [RxsCharacter with: (RxsPredicate unicodeCharacterFrom: self)]<br>
+                                                ifFalse: [RxsCharacter with: lookahead]]]<br>
+                ifFalse: [ | char |<br>
+                        char := RxsCharacter with: lookahead.<br>
+                        self next.<br>
+                        char].<br>
+        self addRangeFrom: first character to: last character!<br>
-        self addRangeFrom: first character to: lookahead.<br>
-        self next!<br>
<br>
Item was changed:<br>
  ----- Method: RxParser>>ifSpecial:then: (in category 'private') -----<br>
  ifSpecial: aCharacter then: aBlock<br>
         "If the character is such that it defines a special node when follows a $\,<br>
         then create that node and evaluate aBlock with the node as the parameter.<br>
         Otherwise just return."<br>
  <br>
         | classAndSelector |<br>
+        classAndSelector := BackslashSpecials at: aCharacter ifAbsent: [<br>
+                " check if we have four hex digits for a unicode code symbol following "<br>
+                (aCharacter = $u and: [RxsPredicate matchesUnicodeSymbol: (input peek: 4)]) ifTrue: [<br>
+                        ^ aBlock value: (RxsPredicate forUnicodeFrom: self)].<br>
+                ^self].<br>
-        classAndSelector := BackslashSpecials at: aCharacter ifAbsent: [^self].<br>
         ^aBlock value: (classAndSelector key new perform: classAndSelector value)!<br>
<br>
Item was added:<br>
+ ----- Method: RxsPredicate class>>forUnicodeFrom: (in category 'instance creation') -----<br>
+ forUnicodeFrom: aParser<br>
+ <br>
+        ^RxsPredicate new beCharacter: (self unicodeCharacterFrom: aParser)!<br>
<br>
Item was added:<br>
+ ----- Method: RxsPredicate class>>matchesUnicodeSymbol: (in category 'helper') -----<br>
+ matchesUnicodeSymbol: aString<br>
+ <br>
+        ^aString size = 4 and: [aString allSatisfy: [:c | c asLowercase between: $0 and: $f]]!<br>
<br>
Item was added:<br>
+ ----- Method: RxsPredicate class>>unicodeCharacterFrom: (in category 'helper') -----<br>
+ unicodeCharacterFrom: aParser<br>
+ <br>
+        ^Character value: (Integer readFrom: aParser next asString, aParser next, aParser next, aParser next base: 16)!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>