Closed alterae closed 2 years ago
we need to parse expressions
this will probably require an architecture a bit different from the rest of the parsing logic so far
https://github.com/alterae/lang/blob/be17b69d0c88f0d3252e906d528ac7cef29de12a/src/parser.rs#L155-L172
https://craftinginterpreters.com/compiling-expressions.html
x - y
+
-
*
/
%
&&
||
foo()
foo::bar("baz:)
3
3.14
(x * (y + z))
"foo"
-x
!
x = y
x := y
we might want to try out pratt parsing
I think I'm gonna follow through Crafting Interpreters again next week, get a better feel for the whole affair.
More relevant readings:
the problem
we need to parse expressions
the solution
this will probably require an architecture a bit different from the rest of the parsing logic so far
the code
https://github.com/alterae/lang/blob/be17b69d0c88f0d3252e906d528ac7cef29de12a/src/parser.rs#L155-L172
the relevant reading
https://craftinginterpreters.com/compiling-expressions.html
the todo list
x - y
)+
)-
)*
)/
)%
)&&
)||
)foo()
,foo::bar("baz:)
)3
,3.14
)(x * (y + z))
)"foo"
)-x
)-
)!
)x = y
)x := y
)