-
Beta Was this translation helpful? Give feedback.
Answered by
msujew
Nov 7, 2023
Replies: 2 comments 2 replies
-
@zrwsmd Does your grammar always expect an element of Langium gives no guarantee that the AST is valid in the presence of parser errors. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the second screenshot you've posted, the parse result clearly contains a parser error.
As for the requirement you're talking about: You could always create a synthetic diagramRoot element and put it into the state object. But I don't really see why this is necessary in the first place. If this is effectively modelling a graph wouldn't the added new node immediately become the root node in the case of an empty file? Why the need for a separate root node?