From 2cf564f73ff9d582fe99752e7c6178f0d76ca48b Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 6 Sep 1999 12:35:11 +0000 Subject: [PATCH] [project @ 1999-09-06 12:35:11 by simonmar] Report layout parse errors as File.hs:10: parse error (possibly incorrect indentation) --- ghc/compiler/parser/ParseUtil.lhs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/parser/ParseUtil.lhs b/ghc/compiler/parser/ParseUtil.lhs index 395d06c..5f63937 100644 --- a/ghc/compiler/parser/ParseUtil.lhs +++ b/ghc/compiler/parser/ParseUtil.lhs @@ -73,8 +73,14 @@ parseError s = srcParseErr :: StringBuffer -> SrcLoc -> Message srcParseErr s l - = hcat [ppr l, ptext SLIT(": parse error on input "), - char '`', text (lexemeToString s), char '\''] + = hcat [ppr l, + if null token + then ptext SLIT(": parse error (possibly incorrect indentation)") + else hcat [ptext SLIT(": parse error on input "), + char '`', text token, char '\''] + ] + where + token = lexemeToString s cbot = panic "CCall:result_ty" -- 1.7.10.4