upgrade parser and AST builder,
moving some error-checking to parsing phase

this allows for simplification of the AST error reporting,
since all errors are found during parsing