[Cuis-dev] [bug?] Inconsistent source ranges for TemporariesDeclarationNode
Nicolás Papagna Maldonado
nicolas.papagna at gmail.com
Wed Mar 26 05:50:42 PDT 2025
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
.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250326/5cd9d0ff/attachment.htm>
More information about the Cuis-dev
mailing list