Stop consuming more bytes as soon as the final terminal is encountered? #277
-
I am trying to embed participle into a larger parser. However it seems that participle will consume all the bytes from the reader. Is there a way to change this behavior? One way I can think of is supplying a custom lexer which emits fake EOF when needed. |
Beta Was this translation helpful? Give feedback.
Answered by
alecthomas
Oct 31, 2022
Replies: 1 comment 3 replies
-
Yep it's totally up to the Lexer. The builtin lexers do not support this at all, and the parser reads the entire token stream into memory before parsing. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
ssquirrel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yep it's totally up to the Lexer. The builtin lexers do not support this at all, and the parser reads the entire token stream into memory before parsing.