X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fparser%2FLexer.x;h=9ab4190b3d2a9dcc9cabee00c523d39b3f21e88b;hb=e4db45612e3efa59251239e1e0b8a0440783b966;hp=16929042233352e6f0e11ff9b2ca0e73fd22c4a3;hpb=13f7bcb0ad0818ad09463d8114a943bd2505ac14;p=ghc-hetmet.git diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 1692904..9ab4190 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -42,8 +42,6 @@ module Lexer ( addWarning ) where -#include "HsVersions.h" - import Bag import ErrUtils import Outputable @@ -1435,8 +1433,8 @@ failMsgP msg = P $ \s -> PFailed (last_loc s) (text msg) failLocMsgP :: SrcLoc -> SrcLoc -> String -> P a failLocMsgP loc1 loc2 str = P $ \_ -> PFailed (mkSrcSpan loc1 loc2) (text str) -failSpanMsgP :: SrcSpan -> String -> P a -failSpanMsgP span msg = P $ \_ -> PFailed span (text msg) +failSpanMsgP :: SrcSpan -> SDoc -> P a +failSpanMsgP span msg = P $ \_ -> PFailed span msg extension :: (Int -> Bool) -> P Bool extension p = P $ \s -> POk s (p $! extsBitmap s) @@ -1705,8 +1703,8 @@ srcParseErr -> Message srcParseErr buf len = hcat [ if null token - then ptext SLIT("parse error (possibly incorrect indentation)") - else hcat [ptext SLIT("parse error on input "), + then ptext (sLit "parse error (possibly incorrect indentation)") + else hcat [ptext (sLit "parse error on input "), char '`', text token, char '\''] ] where token = lexemeToString (offsetBytes (-len) buf) len