diff --git a/src/parser.rs b/src/parser.rs index e288113..bed789f 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -96,7 +96,10 @@ fn statements(input: &mut Tokens) -> ParseResult { } fn statement(input: &mut Tokens) -> ParseResult { - let_expression(input) + match input.peek().map(|i| i.clone()) { + Some(&Keyword(Kw::Let)) => let_expression(input), + _ => expression(input) + } } fn let_expression(input: &mut Tokens) -> ParseResult { @@ -116,6 +119,10 @@ fn let_expression(input: &mut Tokens) -> ParseResult { return ParseResult::Err("Bad parse in let_expression()".to_string()); } +fn expression(input: &mut Tokens) -> ParseResult { + ParseResult::Err("dame".to_string()) +} + fn rhs(input: &mut Tokens) -> ParseResult { let next = input.next(); if let Some(&Identifier(ref value)) = next {