tj / luna

luna programming language - a small, elegant VM implemented in C
2.45k stars 147 forks source link

Parse declaration #77

Closed glhrmfrts closed 8 years ago

glhrmfrts commented 8 years ago

So far the variable/argument declaration is parsed manually throughout the parser, we need a function (e.g. declaration) that produces this and make it uniform. The grammar is:

id {',' id } ':' type_expr

This should be used in productions like the let expression, custom-type fields and function arguments.