未验证 提交 88080293 编写于 作者: A Adam Boniecki 提交者: GitHub

Fix the issue (#14334)

The problem was that we had some cached lexer state when reading new
input during FSI session. If lexer threw an error on a very first token
of new input, the cached lexer state would not get updated, so we would
assosciate old lexer state with this new token that caused an error.

Now we will invalidate that cached state at the begining of reading new
input.
Co-authored-by: NAdam Boniecki <adboniec@microsoft.com>
上级 df5f7bb6
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册