rebcabin / masr

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

Is the parameter `symbol` for `Var` really a `symbol`? Or just an `identifier`? #23

Open rebcabin opened 1 year ago

rebcabin commented 1 year ago

I see (Var 2 a) in a recent output from LPython:

            [(= (Var 2 a)
              (LogicalConstant false (Logical 4 []))
              ())

This does not match the spec in ASR.asdl

    | Var(symbol v)

as a symbol is one of

symbol
    = Program(symbol_table symtab, identifier name, identifier* dependencies,
        stmt* body)
    | Module(symbol_table symtab, identifier name, identifier* dependencies,
        bool loaded_from_mod, bool intrinsic)
    | Function(symbol_table symtab, identifier name, ttype function_signature,
        identifier* dependencies, expr* args, stmt* body, expr? return_var,
        access access, bool deterministic, bool side_effect_free)

etc.

I am guessing that what is really meant is

    | Var(symtab_id stid, identifier it)

and I'll go with this as a workaround, but this is a BLOCKER.