[Cuis-dev] Unnecessary method node for . (dot)
Hernán Wilkinson
hernan.wilkinson at 10pines.com
Sat Sep 20 14:44:34 PDT 2025
Hi,
attached is a .cs that fixes an edge case when having an unnecessary dot
at the beginning of a method, for example:
m1. <-- that dot
^10 factorial
The method node for that source code had a node without source range, it
was:
m1
self. <-- unnecessary generated node and without source range
^10 factorial.
This only happened when the unnecessary dot was before any other statement,
it did not happen for unnecessary dots elsewhere. For example:
m1
1+2.
.
^10 factorial.
generates a method node without the unnecessary self node:
m1
1+2.
^10 factorial
(when the dot was at the beginning of a block, nil was inserted instead of
self).
This behavior made the extract method refactoring fail because of that
unnecessary node without source range.
Attached is the fix and other .cs that remove unnecessary dots I found in
the source code when checking if the fix worked fine. These other cs are
not necessary to apply.
Cheers!
Hernan.
--
*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/20250920/b9de2ab5/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7596-PaserIgnoresInnecesaryDot-HernanWilkinson-2025Sep20-18h01m-HAW.001.cs.st
Type: application/octet-stream
Size: 1638 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250920/b9de2ab5/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7597-RemovesInvalidDots-HernanWilkinson-2025Sep20-18h05m-HAW.001.cs.st
Type: application/octet-stream
Size: 4865 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250920/b9de2ab5/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UnsavedChangesTo-WebClient-HAW.001.cs.st
Type: application/octet-stream
Size: 3306 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250920/b9de2ab5/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UnsavedChangesTo-Network-Kernel-HAW.001.cs.st
Type: application/octet-stream
Size: 431 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250920/b9de2ab5/attachment-0007.obj>
More information about the Cuis-dev
mailing list