Split Node
into Expression
, Statement
and Declaration
#1371
Labels
ast
Issue surrounding the abstract syntax tree
E-Medium
Medium difficulty problem
parser
Issues surrounding the parser
technical debt
Milestone
Currently
Node
is both a expression, statement and declaration. It would be better ifNode
was split into how the spec describes itExpression
,Statement
and alsoDeclaration
. Why do we want this? Right now we don't differentiate between statements (likeif
,while
, etc) and expressions (like2 + 2
), while we could make it work like this, it makes somethings awkward likeif (cond) {}
,cond
should only an expression, and when we parse it we check for this, but some checks can be elided if we leverage the type system, making illegal state unrepresentable.We want to match to what astexplorer outputs.
The text was updated successfully, but these errors were encountered: