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.7.1
+Version:                1.7.2
 License:                BSD3
 License-File:           LICENSE
 Author:                 Niklas Broberg
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
@@ -416,6 +416,7 @@
     lexWhile isSpace
     i <- lexWhile isDigit
     lexWhile isSpace
+    matchChar '"' "Improperly formatted LINE pragma"
     _ <- lexString
     lexWhile isSpace
     mapM (flip matchChar "Improperly formatted LINE pragma") "#-}"
