rebcabin / masr

Meta ASR: replacement for aging ASDL
MIT License
4 stars 0 forks source link

Why is left-hand side of `Assignment` an `expr`? #26

Open rebcabin opened 1 year ago

rebcabin commented 1 year ago
    | Assignment(expr target, expr value, stmt? overloaded)

In all uses I have seen, target is a Var. May I restrict target to be a Var in MASR?

certik commented 1 year ago

It is an expr because it can be any of: Var, ArrayItem, ArraySection, StringItem, StringSection, StructInstanceMember, and maybe a few other expr nodes.

rebcabin commented 1 year ago

thanks. I'll make that explicit with a more refined type, not just any expr, but just the enumerated ones. s/def ::left-hand-of-assignment (s/one of ::Var, ::ArrayItem, etc. something like that.

On Fri, Apr 28, 2023 at 4:31 PM Ondřej Čertík @.***> wrote:

It is an expr because it can be any of: Var, ArrayItem, ArraySection, StringItem, StringSection, StructInstanceMember, and maybe a few other expr nodes.

— Reply to this email directly, view it on GitHub https://github.com/rebcabin/masr/issues/26#issuecomment-1528198065, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABSRR3466MAA6ZYBXFWGZLXDRHOXANCNFSM6AAAAAAXPV6FRE . You are receiving this because you authored the thread.Message ID: @.***>

rebcabin commented 1 year ago

Leaving open as reminder to me to implement