moroso/compiler — pull request #5 by kemurphy (2014-04-28 01:38:50+00:00)
Title: Add AST

This is a refactor of the AST that currently exists in Parser that has slightly shorter names, may be a little friendlier to traverse, and works well with spans. Refactoring the parser to use this AST will take a fair chunk of time, but the conversion should be pretty easy at least. Some useful notes:

* The Show impl for Block will (read: should) autoindent and does not leave a trailing newline after the closing brace.
* FuncDecls take a Block as their body definition.
* IfExprs take an Expr and two Blocks.
* ParamType has an ident -- the intention is these are created when an ident in a type position matches any element of a FuncDecl's type parameter vector. As a sanity check, when they are later used, the user should verify that the ident exists in the FuncDecl's vector.