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
For some shell-like grammars where statements terminated by a newline having EndOfInput, or even injecting the Newline itself at the end, can make parsing unterminated trailing statements much easier, because you can define a Statement = Command+ (Newline | EndOfInput).
Without this feature I just made a wrapper that returns one additional token after Logos returned None.
The text was updated successfully, but these errors were encountered:
I understand that this requires to manually add the last token using chain, but I don't think Logos can actually do something better than that :-/
My feeling is if you use chain you lose the logos::Lexer type, so you can't easily access lexer.span(), lexer.slice() and lexer.extras anymore: pub struct Chain<A, B> { /* private fields */ }. Having this function as part of logos makes a difference.
It would be really convenient to have an ability to inject custom EndOfInput token, just before the lexer starts to return None.
For some shell-like grammars where statements terminated by a newline having EndOfInput, or even injecting the Newline itself at the end, can make parsing unterminated trailing statements much easier, because you can define a
Statement = Command+ (Newline | EndOfInput)
.Without this feature I just made a wrapper that returns one additional token after Logos returned None.
The text was updated successfully, but these errors were encountered: