Added skeleton of expression() parser
This commit is contained in:
parent
1342a76786
commit
46999beabf
@ -96,7 +96,10 @@ fn statements(input: &mut Tokens) -> ParseResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn statement(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 {
|
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());
|
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 {
|
fn rhs(input: &mut Tokens) -> ParseResult {
|
||||||
let next = input.next();
|
let next = input.next();
|
||||||
if let Some(&Identifier(ref value)) = next {
|
if let Some(&Identifier(ref value)) = next {
|
||||||
|
Loading…
Reference in New Issue
Block a user