[Cuis-dev] Subtle Parser bug?

Phil B pbpublist at gmail.com
Mon Nov 30 11:21:09 PST 2020


Hi Nico,

The bug is in your source code ;-)  The self is due to the fact that you
have 'foo.' instead of just 'foo' (i.e. you don't need the $. to terminate
your args and any empty expressions in the body, which the trailing $. will
be parsed as, will result in a self).

Thanks,
Phil

On Mon, Nov 30, 2020 at 7:59 AM Nicolás Papagna Maldonado via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Hi folks!
>
> Hope. you're doing fine :)
>
> I ran into this (bug?) yesterday while inspecting existing compiled
> methods at Cuis University.
> Looks like if you parse/compile a method that has a dot after the last
> collaborator in the method signature, an additional *self* node is added
> to the AST.
>
> To reproduce it, in a workspace inspect:
>
> Parser new
>   parse: 'm1: foo. ^1'
>   class: Object
>
> You'll note that the string representation of the inspected MethodNode
> displays:
>
> m1: foo
>   *self.*
>   ^ 1.
>
> Is that little *self *node there for a reason, or is it just a bug?
>
> Best,
> Nico PM
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20201130/7c19995f/attachment.htm>


More information about the Cuis-dev mailing list