Fix let clause parsing

let a = x, x should be expression not just simple expression
This commit is contained in:
greg 2015-07-26 02:38:31 -07:00
parent cdb47bb3b9
commit 8b6d54aec2

View File

@ -109,7 +109,7 @@ fn let_expression(tokens: &mut Tokens) -> ParseResult {
if let Some(&Identifier(ref name)) = tokens.next() {
if let Some(&Identifier(ref s)) = tokens.next() {
if s == "=" {
if let ParseResult::Ok(expr) = simple_expression(tokens) {
if let ParseResult::Ok(expr) = expression(tokens) {
return ParseResult::Ok(
AST::Binding(name.clone(),
Box::new(expr)));