<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 10 mai 2020 à 13:22, Thiede, Christoph <<a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de">Christoph.Thiede@student.hpi.uni-potsdam.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div>


<div dir="ltr">
<div id="gmail-m_-39566867721866408x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif">
<p>Hi Nicolas,</p>
<p><br>
</p>
<p>Does this work for you? #copyReplaceAll:with: appears not to accept regexes.</p>
<p>For example, consider this output:</p>
<p><span><b>'123' copyReplaceAll: '\d' with: 'x'. "'123'"</b></span><br>
</p>
<p><span><br></span></p></div></div></div></blockquote><div>Ouch! obviously, this was a low quality commit... <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="ltr"><div id="gmail-m_-39566867721866408x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif"><p><span>
</span></p>
<p><span>On my machine, the following does not work:</span></p>
<p><span><img size="9529" id="gmail-m_-39566867721866408x_img290284" style="max-width: 99.9%;" src="cid:171fe9b1caaf456b1e51"><br>
</span></p>
<p><span>I selected everything and pressed <cmd>m. I would rather expect to be notified that there are not implementors of #foo:?</span></p>
<p><span><br>
</span></p>
<p><span>(By the way, see also the discussion <a href="http://forum.world.st/The-Inbox-Collections-ct-885-mcz-td5114711.html" target="_blank">
in this thread</a>. #copyReplaceAll:with: and #copyWithRegex:matchesReplacedWith: is another pair of similar-featured methods that maybe could be merged if we created a common protocol for comparison and matching ...)</span></p>
<p><span><br>
</span></p>
<p><span>Best,</span></p>
<p><span>Christoph</span></p>
<div id="gmail-m_-39566867721866408x_Signature">
<div id="gmail-m_-39566867721866408x_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">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-39566867721866408x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>Von:</b> Squeak-dev <<a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" target="_blank">squeak-dev-bounces@lists.squeakfoundation.org</a>> im Auftrag von <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>><br>
<b>Gesendet:</b> Samstag, 9. Mai 2020 18:27:53<br>
<b>An:</b> <a href="mailto:squeak-dev@lists.squeakfoundation.org" target="_blank">squeak-dev@lists.squeakfoundation.org</a>; <a href="mailto:packages@lists.squeakfoundation.org" target="_blank">packages@lists.squeakfoundation.org</a><br>
<b>Betreff:</b> [squeak-dev] The Trunk: Collections-nice.891.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt">
<div>Nicolas Cellier uploaded a new version of Collections to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Collections-nice.891.mcz" target="_blank">http://source.squeak.org/trunk/Collections-nice.891.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-nice.891<br>
Author: nice<br>
Time: 9 May 2020, 6:27:51.164977 pm<br>
UUID: 4b4cd1ee-3b62-4ee2-b819-5b4481f6ecee<br>
Ancestors: Collections-nice.890<br>
<br>
Find a selector in a line containing an assignment<br>
<br>
This uses new (negative) lookahead extensions to Regex (hence requires Regex >= Regex-Core-ct.56).<br>
<br>
Example: try alt+m in following line (extracted from these changes):<br>
<br>
        sel := sel copyReplaceAll: ':(?!=)' with: ': '. "blah"<br>
<br>
=============== Diff against Collections-nice.890 ===============<br>
<br>
Item was changed:<br>
  ----- Method: String>>findSelector (in category 'converting') -----<br>
  findSelector<br>
         "Dan's code for hunting down selectors with keyword parts; while this doesn't give a true parse, in most cases it does what we want, in where it doesn't, we're none the worse for it."<br>
         | sel possibleParens |<br>
         sel := self withBlanksTrimmed.<br>
         (sel includes: $:)<br>
                 ifTrue:<br>
                         [sel := sel copyWithRegex: '''[^'']*''' matchesReplacedWith: '''a string'''.<br>
                         sel := sel copyWithRegex: '#[^\[\(\s\.$]*' matchesReplacedWith: '#aSymbol'.<br>
                         sel := sel copyWithRegex: '\$.' matchesReplacedWith: '$x'. "handle $( $[ and $:"<br>
+                        sel := sel copyReplaceAll: ':(?!!=)' with: ': '.        "for the style (aa max:bb) with no space"<br>
-                        sel := sel copyReplaceAll: ':' with: ': '.      "for the style (aa max:bb) with no space"<br>
                         sel := sel copyReplaceAll: '[:' with: '[ :'.    "for the style ([:a) with no space" 
<br>
                         possibleParens := sel substrings.<br>
                         sel := self class streamContents:<br>
                                 [:s | | level |<br>
                                 level := 0.<br>
                                 possibleParens do:<br>
                                         [:token |<br>
                                         (level = 0 and: [token endsWith: ':'])<br>
                                                 ifTrue: [s nextPutAll: token]<br>
                                                 ifFalse: [level := level<br>
                                                                 + (token occurrencesOf: $() - (token occurrencesOf: $))<br>
                                                                 + (token occurrencesOf: $[) - (token occurrencesOf: $])<br>
                                                                 + (token occurrencesOf: ${) - (token occurrencesOf: $})]]]]<br>
                 ifFalse:<br>
                         [sel := self substrings ifNotEmpty: [:tokens | tokens last]].<br>
         sel ifEmpty: [^ nil].<br>
         sel first = $# ifTrue:<br>
                 [sel := sel allButFirst.<br>
                 sel ifEmpty: [^ nil]].<br>
         sel isOctetString ifTrue: [sel := sel asOctetString].<br>
         ^ Symbol lookup: sel!<br>
<br>
<br>
</div>
</span></font>
</div>

<br>
</blockquote></div></div>