Replies: 1 comment 3 replies
-
This is what the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am enjoying this library and it is being very helpful in use with an LSP.
However, I am quite confused on some parsing in relation to that type of environment. For example, with the following code, I can easily chain a parser per section with
or_not
s and that works fine:shader lit { extern { } stage name { } stage name { } }
The problem arises when the user does any invalid match in a parser, such as during autocomplete:
I want to still match the entire
shader
scope with my parser, but if it hits a bad entry, then I lose everything pastfoo
, and my shaderSpan
no longer covers the entireshader
scope.Is there a way to essentially make a parser that will scan for what it requires, but also continue past invalid matches? Or even better for my case, if I can throw all the invalids into a
Vec
to debug later? That would make it easier to still collect the user's bad input as a token.This is my current parser for the shader portion:
Is there a general approach used with LSP parsing for these kinds of things?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions