diff --git a/haskell-src-exts.cabal b/haskell-src-exts.cabal
--- a/haskell-src-exts.cabal
+++ b/haskell-src-exts.cabal
@@ -1,5 +1,5 @@
 Name:                   haskell-src-exts
-Version:                1.4.0
+Version:                1.5.0
 License:                BSD3
 License-File:           LICENSE
 Author:                 Niklas Broberg
diff --git a/src/Language/Haskell/Exts.hs b/src/Language/Haskell/Exts.hs
--- a/src/Language/Haskell/Exts.hs
+++ b/src/Language/Haskell/Exts.hs
@@ -67,7 +67,7 @@
 
 -- | Parse a source file from a string using a custom parse mode.
 parseFileContentsWithMode :: ParseMode -> String -> ParseResult Module
-parseFileContentsWithMode p@(ParseMode fn exts ign _) rawStr =
+parseFileContentsWithMode p@(ParseMode fn exts ign _ _) rawStr =
         let md = delit fn $ ppContents rawStr
             allExts = impliesExts $ case (ign, readExtensions md) of
                                      (False,Just es) -> exts ++ es
diff --git a/src/Language/Haskell/Exts/Annotated.hs b/src/Language/Haskell/Exts/Annotated.hs
--- a/src/Language/Haskell/Exts/Annotated.hs
+++ b/src/Language/Haskell/Exts/Annotated.hs
@@ -86,7 +86,7 @@
 
 -- | Parse a source file from a string using a custom parse mode.
 parseFileContentsWithMode :: ParseMode -> String -> ParseResult (Module SrcSpanInfo)
-parseFileContentsWithMode p@(ParseMode fn exts ign _) rawStr =
+parseFileContentsWithMode p@(ParseMode fn exts ign _ _) rawStr =
         let md = delit fn $ ppContents rawStr
             allExts = impliesExts $ case (ign, readExtensions md) of
                                      (False,Just es) -> exts ++ es
@@ -94,7 +94,7 @@
          in parseModuleWithMode (p { extensions = allExts }) md
 
 parseFileContentsWithComments :: ParseMode -> String -> ParseResult (Module SrcSpanInfo, [Comment])
-parseFileContentsWithComments p@(ParseMode fn exts ign _) rawStr =
+parseFileContentsWithComments p@(ParseMode fn exts ign _ _) rawStr =
         let md = delit fn $ ppContents rawStr
             allExts = impliesExts $ case (ign, readExtensions md) of
                                      (False,Just es) -> exts ++ es
diff --git a/src/Language/Haskell/Exts/Lexer.hs b/src/Language/Haskell/Exts/Lexer.hs
--- a/src/Language/Haskell/Exts/Lexer.hs
+++ b/src/Language/Haskell/Exts/Lexer.hs
@@ -340,9 +340,14 @@
 lexWhiteSpace :: Bool -> Lex a (Bool, Bool)
 lexWhiteSpace bol = do
     s <- getInput
+    ignL <- ignoreLinePragmasL
     case s of
         -- If we find a recognised pragma, we don't want to treat it as a comment.
         '{':'-':'#':rest | isRecognisedPragma rest -> return (bol, False)
+                         | isLinePragma rest && not ignL -> do 
+                            l <- lexLinePragma
+                            setSrcLineL l
+                            lexWhiteSpace True
         '{':'-':_ -> do
             loc <- getSrcLocL
             discard 2
@@ -380,11 +385,30 @@
             return (bol, True)
         _ -> return (bol, False)
 
-isRecognisedPragma :: String -> Bool
+isRecognisedPragma, isLinePragma :: String -> Bool
 isRecognisedPragma str = let pragma = map toLower . takeWhile isAlphaNum . dropWhile isSpace $ str
                           in case lookup pragma pragmas of
                               Nothing -> False
                               _       -> True
+
+isLinePragma str = let pragma = map toLower . takeWhile isAlphaNum . dropWhile isSpace $ str
+                    in case pragma of
+                        "line"  -> True
+                        _       -> False
+
+lexLinePragma :: Lex a Int
+lexLinePragma = do
+    discard 3   -- {-#
+    lexWhile isSpace
+    discard 4   -- LINE
+    lexWhile isSpace
+    i <- lexWhile isDigit
+    lexWhile isSpace
+    _ <- lexString
+    lexWhile isSpace
+    mapM (flip matchChar "Improperly formatted LINE pragma") "#-}"
+    lexNewline
+    return (read i)
 
 lexNestedComment :: Bool -> String -> Lex a (Bool, String)
 lexNestedComment bol str = do
diff --git a/src/Language/Haskell/Exts/ParseMonad.hs b/src/Language/Haskell/Exts/ParseMonad.hs
--- a/src/Language/Haskell/Exts/ParseMonad.hs
+++ b/src/Language/Haskell/Exts/ParseMonad.hs
@@ -24,7 +24,8 @@
         -- * Lexing
         Lex(runL), getInput, discard, lexNewline, lexTab, lexWhile,
         alternative, checkBOL, setBOL, startToken, getOffside,
-        pushContextL, popContextL, getExtensionsL, pushComment, getSrcLocL,
+        pushContextL, popContextL, getExtensionsL, pushComment, 
+        getSrcLocL, setSrcLineL, ignoreLinePragmasL,
         -- * Harp/Hsx
         ExtContext(..),
         pushExtContextL, popExtContextL, getExtContext,
@@ -114,6 +115,9 @@
         -- | if 'True', the parser won't care about further extensions
         --   in LANGUAGE pragmas in source files
         ignoreLanguagePragmas :: Bool,
+        -- | if 'True', the parser won't read line position information
+        --   from LINE pragmas in source files
+        ignoreLinePragmas :: Bool,
         -- | list of fixities to be aware of
         fixities :: [Fixity]
         }
@@ -121,13 +125,14 @@
 -- | Default parameters for a parse.
 --   The default is an unknown filename,
 --   no extensions (i.e. Haskell 98),
---   don't ignore LANGUAGE pragmas,
+--   don't ignore LANGUAGE pragmas, do ignore LINE pragmas,
 --   and be aware of fixities from the 'Prelude'.
 defaultParseMode :: ParseMode
 defaultParseMode = ParseMode {
         parseFilename = "<unknown>.hs",
         extensions = [],
         ignoreLanguagePragmas = False,
+        ignoreLinePragmas = True,
         fixities = preludeFixities
         }
 
@@ -354,6 +359,10 @@
 getSrcLocL = Lex $ \cont -> P $ \i x y l ->
         runP (cont (l { srcLine = y, srcColumn = x })) i x y l
 
+setSrcLineL :: Int -> Lex a ()
+setSrcLineL y = Lex $ \cont -> P $ \i x _ ->
+        runP (cont ()) i x y
+
 pushContextL :: LexContext -> Lex a ()
 pushContextL ctxt = Lex $ \cont -> P $ \r x y loc (stk, e, pst, cs) ->
         runP (cont ()) r x y loc (ctxt:stk, e, pst, cs)
@@ -397,6 +406,12 @@
 getExtensionsL :: Lex a [Extension]
 getExtensionsL = Lex $ \cont -> P $ \r x y loc s m ->
         runP (cont $ extensions m) r x y loc s m
+
+-- LINE-aware lexing
+
+ignoreLinePragmasL :: Lex a Bool
+ignoreLinePragmasL = Lex $ \cont -> P $ \r x y loc s m ->
+        runP (cont $ ignoreLinePragmas m) r x y loc s m
 
 -- Comments
 
