Closed cvauclair closed 3 years ago
The Mesh language grammar should support the definition of modules.
Add a new variant to the expr type EMod(list(expr))
expr
EMod(list(expr))
E.g.: The following expression
module M = { let x = 1; let f = (a) => a; };
would be parsed as:
EMod( ELet(PVar("x"), ELit(Int(1))), ELet(PVar("f"), EFun(PVar("a"), EVar("a"))) )
Description
The Mesh language grammar should support the definition of modules.
Proposed approach
Add a new variant to the
expr
typeEMod(list(expr))
Example
E.g.: The following expression
would be parsed as: