diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index 88a743a6bf2..14a43332424 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -699,6 +699,8 @@ type LexFilterImpl ( let mutable prevWasAtomicEnd = false let peekInitial() = + // Forget the lexbuf state we might have saved from previous input + haveLexbufState <- false let initialLookaheadTokenTup = popNextTokenTup() if debug then dprintf "first token: initialLookaheadTokenLexbufState = %a\n" outputPos (startPosOfTokenTup initialLookaheadTokenTup)