parseFromString': reset stateLastStrPos to Nothing before parse.

This commit is contained in:
John MacFarlane 2019-08-26 15:52:25 -07:00
parent 1dec5bacaa
commit b446c6c448

View file

@ -462,6 +462,7 @@ parseFromString' :: (Stream s m Char, IsString s, HasLastStrPosition u)
-> ParserT s u m a
parseFromString' parser str = do
oldLastStrPos <- getLastStrPos <$> getState
updateState $ setLastStrPos Nothing
res <- parseFromString parser str
updateState $ setLastStrPos oldLastStrPos
return res