Empty program is valid too

This commit is contained in:
greg 2015-07-24 02:08:55 -07:00
parent 1ae61287c1
commit a97cce184c

View File

@ -52,6 +52,10 @@ pub fn parse(input: Vec<Token>) -> ParseResult {
let mut tokens: Tokens = input.iter().peekable();
if let Some(&&EOF) = tokens.peek() {
return ParseResult::Ok(AST::Statements(vec!()));
}
match statements(&mut tokens) {
ok@ParseResult::Ok(_) => {
expect!(EOF, &mut tokens);