From 56f147d470b4ea26dd279554eb71cf419579bce4 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 21 Apr 2009 09:45:58 +0000 Subject: [PATCH] FIX #3153: we lost an EOF sentinel in the event of a lexical error --- compiler/main/HeaderInfo.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs index 89f4661..0fd62f5 100644 --- a/compiler/main/HeaderInfo.hs +++ b/compiler/main/HeaderInfo.hs @@ -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 ()) -- 1.7.10.4