<div dir="ltr">Hi folks,<br><div><br></div><div>I found out that the source ranges for temporaries declaration nodes are sometimes computed differently:</div><ol><li>git clone --depth=1 <a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev.git">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev.git</a> bug_repro</li><li>Open Cuis from that folder</li><li>Open a workspace</li><li>Evaluate <font face="monospace" style="background-color:rgb(238,238,238)">Object compile: 'm1 ||'</font></li>Print <font face="monospace"><span style="background-color:rgb(238,238,238)">(Object >> #m1) methodNode rawSourceRanges.</span><br></font>This outputs <font face="monospace"><span style="background-color:rgb(238,238,238)">a Dictionary({| |}->(4 to: 4) )</span><br></font>Notice the informed source range for the temporaries declaration node is just one character (at position 4), not two.<br><li>Evaluate <font face="monospace"><span style="background-color:rgb(238,238,238)">Object compile: 'm1 || '</span><br></font>Notice there is a space after <font face="monospace"><span style="background-color:rgb(238,238,238)">||</span></font></li>Print <font face="monospace"><span style="background-color:rgb(238,238,238)">(Object >> #m2) methodNode rawSourceRanges.</span><br></font>This outputs <font face="monospace"><span style="background-color:rgb(238,238,238)">a Dictionary({| |}->(4 to: 5) )</span><br></font>Notice the informed source range is correct now.</ol>Even though I used a space at the end of the declaration in step 5, it works for newlines too (In fact, that's how I found the bug in one of my methods).<div><br></div><div>I don't know if this bug affects the source ranges of other parse nodes.<br><div><br></div><div>Cheers!</div><div>Nico PM<br>.</div></div></div>