[Cuis-dev] [bug?] Inconsistent source ranges for TemporariesDeclarationNode

Hernán Wilkinson hernan.wilkinson at 10pines.com
Wed Mar 26 08:56:46 PDT 2025


I think it is a bug. I do not see why it should work that way...
The problem is, is there code that relies on this behavior? and if so, how
do we find it?

On Wed, Mar 26, 2025 at 9:51 AM Nicolás Papagna Maldonado via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Hi folks,
>
> I found out that the source ranges for temporaries declaration nodes are
> sometimes computed differently:
>
>    1. git clone --depth=1
>    https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev.git bug_repro
>    2. Open Cuis from that folder
>    3. Open a workspace
>    4. Evaluate Object compile: 'm1 ||'Print (Object >> #m1) methodNode
>    rawSourceRanges.
>    This outputs a Dictionary({| |}->(4 to: 4) )
>    Notice the informed source range for the temporaries declaration node
>    is just one character (at position 4), not two.
>    5. Evaluate Object compile: 'm1 || '
>    Notice there is a space after ||Print (Object >> #m2) methodNode
>    rawSourceRanges.
>    This outputs a Dictionary({| |}->(4 to: 5) )
>    Notice the informed source range is correct now.
>
> 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).
>
> I don't know if this bug affects the source ranges of other parse nodes.
>
> Cheers!
> Nico PM
> .
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250326/ea9fcb67/attachment.htm>


More information about the Cuis-dev mailing list