Commit 56f147d4 authored by Simon Marlow's avatar Simon Marlow

FIX #3153: we lost an EOF sentinel in the event of a lexical error

parent 709c9ce0
......@@ -123,8 +123,9 @@ lazyGetToks dflags filename handle = do
_other -> do rest <- lazyLexBuf handle state' eof
return (t : rest)
_ | not eof -> getMore handle state
| otherwise -> return []
| otherwise -> return [L (last_loc state) ITeof]
-- parser assumes an ITeof sentinel at the end
getMore :: Handle -> PState -> IO [Located Token]
getMore handle state = do
-- pprTrace "getMore" (text (show (buffer state))) (return ())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment