Feedback to increase code quality would be highly appreciated.
I'd
I'd also like to know if I'm missing crucial features a lexer/parser would have to include. If I'm doing anything inherently wrong or do use inappropriate techniques, that would be helpful to know as well.
If I'm doing anything inherently wrong or do use inappropriate techniques, that would be helpful to know as well.
You can flatten the recursive structure of the AST by changing the grammar of addition and multiplication tokens to repeatedly parse its rhsRHS while its condition matches by using .repeat, or by using .unfold which recurses first and flattens the structure after parsing the node. This can reduce the size of the AST a lot.