Open UnexDev opened 1 month ago
You can return a Token from your callback. There's also utilities like Filter, Skip, FilterResult, etc. See https://logos.maciej.codes/callbacks.html
You can return a Token from your callback. There's also utilities like Filter, Skip, FilterResult, etc. See https://logos.maciej.codes/callbacks.html
Thank you, that worked wonderfully!
Just one more thing - can I emit multiple tokens of the same type? I need to emit multiple dedent
tokens. I'm assuming this is not possible?
Just one more thing - can I emit multiple tokens of the same type? I need to emit multiple
dedent
tokens. I'm assuming this is not possible?
I don't think it's possible, but I decided to use a Dedent(usize)
token as a workaround.
Is it possible to emit an alternate token from a callback (i.e not the lexed token)?
For example, a stack-based white-space-sensetive parser: `fn indent(lex: &mut logos::Lexer) -> / ??? / {
let extras = &mut lex.extras;
let mut indent = 0;
}`