Skip to content

How can I use these, getOrCreateDocument and initializeWorkspace in CLI? #1700

Answered by msujew
negahama asked this question in Q&A
Discussion options

You must be logged in to vote

Looking at this through a profiler, it seems like the parser is taking a very long time on your files - mainly with attempting to perform the lookahead. This indicates very long common prefixes in the grammar:

Looking at your grammar, it seems like your language features a lot of ambiguity in the first few tokens. For example ForOf and ForTo can be joined into a single rule, and everything that starts with (Annotation)? (export?='export')? (private?='private')? (static?='static')? can be moved into a single prefixed rule that then fans out into different branches. Also, the lookahead creates a warning in your code saying that Block is completely ambiguous:

Ambiguous Alternatives Detected…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@negahama
Comment options

@msujew
Comment options

Answer selected by negahama
Comment options

You must be logged in to vote
3 replies
@msujew
Comment options

@negahama
Comment options

@msujew
Comment options

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