You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The emit statement is currently represented in the AST as:
Emit {
value: Node<Expr>,
},
This suggests that the right hand side can be any expression such as emit get_some_event() or emit SomeEvent() if condition else OtherEvent().
However, that is not actually allowed and we reject these cases in the analyzer pass. If the right hand side is not actually allowed to be an expression (it is unclear to me if it ever could) then we should change the AST representation to something that prevents that in the first place.
How can it be fixed
Probably change the Emit node to something with just name and args fields
Change the parser to parse it according to the new representation
Refactor the analyzer pass to get rid of the current checks that are concerned with syntax
The text was updated successfully, but these errors were encountered:
What is wrong?
The
emit
statement is currently represented in the AST as:This suggests that the right hand side can be any expression such as
emit get_some_event()
oremit SomeEvent() if condition else OtherEvent()
.However, that is not actually allowed and we reject these cases in the analyzer pass. If the right hand side is not actually allowed to be an expression (it is unclear to me if it ever could) then we should change the AST representation to something that prevents that in the first place.
How can it be fixed
Emit
node to something with justname
andargs
fieldsThe text was updated successfully, but these errors were encountered: