Improved Grammar, Implemented Parsing to IR#10
Conversation
|
For the function |
|
I saw one of the |
the field |
|
This is what @fpham0701 is refering to: https://github.com/ekiwi/protocols/blob/6ad45f0259494569b5c3b7d679df4da26565a7d9/src/ir.rs#L330 |
| self.structs.keys().collect() | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
This required changing the implementation of the indexing and fixing the test cases that use it accordingly. I then removed the helper function I was using and replaced it with this more simple indexing.
The only thing to consider as a downside is that it is harder to capture a parsing failure (e.g. someone attempts to assign to an undeclared variable, an expression refers to a non-existent symbol) and return an expressive error message now because this panics with "no entry found for key"
There was a problem hiding this comment.
Okay, I've reverted for now after deciding that the panic issue causes problems for proper error handling in the parsing stage.
This reverts commit 18cb190.
Grammar and Lexing Changes:
else ifstatements and other complexities for now.<T>).assert_eqas a new statement type.IR Changes:
BoxedExpr:Expr.pest’sPrattParser, avoiding Rust’s compilation issues when mutating the same structure within multiple closures.symbol_id_from_nameandstruct_id_from_name; required for correct parsing of symbols and struct definitions.Serialize & Typecheck Updates:
Ops) are now independent enumerations.Parser Changes:
parser.rs.