Bravo!<br><br><div class="gmail_quote">On Wed, Feb 22, 2012 at 5:57 AM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Compiler-nice.225.mcz" target="_blank">http://source.squeak.org/trunk/Compiler-nice.225.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Compiler-nice.225<br>
Author: nice<br>
Time: 22 February 2012, 2:57:07.872 pm<br>
UUID: 77bbb3ac-e939-4975-a139-f785dc94c17a<br>
Ancestors: Compiler-nice.224<br>
<br>
Remove the ugly hack in Parser&gt;&gt;expected: which was modifying the error message insertion mark depending on the fact that we were at end of token stream a,d/or end of source character stream.<br>
<br>
Replace it with a proper mark in Scanner&gt;&gt;scanToken that correctly take into account the two step of advance handled by the Scanner (stateful is harmful and require high precision surgery).<br>
<br>
While at it, set the error insertion mark after the $ character when offended by Scanner&gt;&gt;xDollar.<br>
<br>
This efficiently reduce the number of failures reported by CompilerNotifyngTest in its Tests-nice.144 version.<br>
<br>
=============== Diff against Compiler-nice.224 ===============<br>
<br>
Item was changed:<br>
  ----- Method: Parser&gt;&gt;expected: (in category &#39;error handling&#39;) -----<br>
  expected: aString<br>
        &quot;Notify a problem at token &#39;here&#39;.&quot;<br>
<br>
-       tokenType == #doIt ifTrue: [hereMark := hereMark + 1].<br>
-       hereType == #doIt ifTrue: [hereMark := hereMark + 1].<br>
        ^ self notify: aString , &#39; expected&#39; at: hereMark + requestorOffset!<br>
<br>
Item was changed:<br>
  ----- Method: Scanner&gt;&gt;scanToken (in category &#39;expression types&#39;) -----<br>
  scanToken<br>
<br>
        [(tokenType := self typeTableAt: hereChar) == #xDelimiter]<br>
                whileTrue: [self step].  &quot;Skip delimiters fast, there almost always is one.&quot;<br>
        mark := aheadChar == DoItCharacter<br>
+               ifTrue: [hereChar == DoItCharacter<br>
+                       ifTrue: [source position + 1]<br>
+                       ifFalse: [source position]]<br>
-               ifTrue: [source position]<br>
                ifFalse: [source position - 1].<br>
        (tokenType at: 1) == $x &quot;x as first letter&quot;<br>
                ifTrue: [self perform: tokenType &quot;means perform to compute token &amp; type&quot;]<br>
                ifFalse: [token := self step asSymbol &quot;else just unique the first char&quot;].<br>
        ^token!<br>
<br>
Item was changed:<br>
  ----- Method: Scanner&gt;&gt;xDollar (in category &#39;multi-character scans&#39;) -----<br>
  xDollar<br>
        &quot;Form a Character literal.&quot;<br>
<br>
+       aheadChar == DoItCharacter<br>
+               ifTrue:<br>
+                       [mark := mark + 1. &quot;Let the notification lie behind the dollar&quot;<br>
+                       ^self offEnd: &#39;A Character was expected&#39;].<br>
-       aheadChar == DoItCharacter ifTrue: [^self offEnd: &#39;A Character was expected&#39;].<br>
        self step. &quot;pass over $&quot;<br>
        token := self step.<br>
        tokenType := #character!<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>