Skip to content

Improve Expression Parsing #28

@jalextowle

Description

@jalextowle

Description

The current strategy for parsing expressions is bulky, unmaintainable, and most likely incorrect. A better strategy is needed.

Strategy

  1. 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).
  2. The collection of tokens should be parsed using a function:
fn parse_expression(expression: &mut Vec<lex::Token>) -> ParseNode
  1. The parse_expression function should likely use a LR parsing strategy, or at the very least employ the Shunting-yard Algorithm.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions