rebcabin / masr

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

What are allowed `node*` in `TranslationUnit`? #30

Open rebcabin opened 1 year ago

rebcabin commented 1 year ago

The ASDL spec for TranslationUnit says node*

unit
    = TranslationUnit(symbol_table global_scope, node* items)

Surely not all nodes are allowed. Can it be Function, Program, etc., i.e., whats the actual list of allowed nodes at this level?

rebcabin commented 1 year ago

I could, as a workaround, make node* a type alias for term*. In that case, the following would be legal:

(def tu (TranslationUnit 
          (SymbolTable 42 {})
          [Eq])

because Eq is a cmpop, thus an expr, thus a term, thus a node; and [Eq] is an expr*, thus a term*, thus a node*.

Such an expression as tu does not seem intentionally legal. Without further refinement of the type node* as requested in this issue, I cannot eliminate tu.