Skip to content
Discussion options

You must be logged in to vote

If you allow functions at a statement level, then I would recommend to remove them at the top level and add appropriate validations that correctly handle functions at each level. Everything else will probably lead to a lot of headache, at least in my experience.

It's usually for the better to be more flexible during the parsing phase and then prevent invalid programs using the validation feature of Langium. This also allows to create more fine-grained and understandable error messages. Parser errors can be quite cryptic, as you've already pointed out.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@trusktr
Comment options

@msujew
Comment options

@spoenemann
Comment options

@trusktr
Comment options

Answer selected by trusktr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants