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
There's no CONSUME_ANY_TOKEN in the public API, but you can use SKIP_TOKEN. However that doesn't return the skipped token (which is what I would expect), but rather the token after the skipped token.
Example to skip over all tokens until the next comma
I think the main problem is that SKIP_TOKEN lacks documentation
In regards to the code snippet.
There is no need to wrap the SKIP_TOKEN with the MANY you can use a simple loop instead.
The only things that must be wrapped with the grammar methods are the grammar methods themselves, e.g CONSUME inside of MANY
SKIP_TOKEN is currently used internally for recovery related logic, I guess in that scenario it made more sense discard the skipped token. Perhaps other utilities should be exposed to make your use case easy to implement?
Although LA(1) provides you with the "next_token" so maybe that is sufficient for your scenario.
There's no CONSUME_ANY_TOKEN in the public API, but you can use SKIP_TOKEN. However that doesn't return the skipped token (which is what I would expect), but rather the token after the skipped token.
Example to skip over all tokens until the next comma
The text was updated successfully, but these errors were encountered: