[parser, types] Add Obj::take() and use it to take the Obj from the parser when it is done

This commit is contained in:
Eryn Wells 2018-08-23 18:04:04 -07:00
parent 929846152e
commit 8e9fde7a9f
2 changed files with 8 additions and 1 deletions

View file

@ -30,8 +30,10 @@ impl NodeParser for ListParser {
Token::Id => {
let parser = SymParser{};
NodeParseResult::Push { next: Box::new(parser) }
},
Token::RightParen => {
NodeParseResult::Complete { obj: self.list.take() }
}
_ => NodeParseResult::Error { msg: "womp".to_string() }
}
}
}