I'm trying to implement Python-like white-space indentation(read as: emit indent/dedent tokens where needed) with FsLexYacc.
It seems like FsLexYacc is not able to use unput
which is what the C/C++ examples for lexing white-space based indentation use. I tried to use an additional argument as "indent stack" during lexing but not being able to return more than one token per lex rule made it impossible to return all pending dedents at the end of the file or multiple dedents when needed inbetween.
Is there a way to implement white-space based indentation in FsLexYacc without the need to tokenize the complete string first and applying a separate pass over all tokens to replace the whitespaces with indents/dedents where appropriate? (even this possible solution seems hard to get to work with a (LexBuffer<char> -> token)
signature, to be able to pass it into the generated Parser)