Description
The current strategy for parsing expressions is bulky, unmaintainable, and most likely incorrect. A better strategy is needed.
Strategy
- Once it is determined that an expression needs to be parsed, tokens should be collected until a semicolon is found (the terminator of an expression statement).
- The collection of tokens should be parsed using a function:
fn parse_expression(expression: &mut Vec<lex::Token>) -> ParseNode
- The
parse_expression function should likely use a LR parsing strategy, or at the very least employ the Shunting-yard Algorithm.
Description
The current strategy for parsing expressions is bulky, unmaintainable, and most likely incorrect. A better strategy is needed.
Strategy
parse_expressionfunction should likely use a LR parsing strategy, or at the very least employ the Shunting-yard Algorithm.