diff options
| author | Thomas Miedema <thomasmiedema@gmail.com> | 2015-10-07 20:36:54 -0500 |
|---|---|---|
| committer | Austin Seipp <austin@well-typed.com> | 2015-10-07 20:37:23 -0500 |
| commit | e2b579e8d77357e8b36f57d15daead101586ac8e (patch) | |
| tree | 83b1d7dfccaceaf27a8bfafd07473c70d326b8b3 /compiler/parser | |
| parent | 69a6e4258786894578ffed2a1d907a74c52d779b (diff) | |
| download | haskell-e2b579e8d77357e8b36f57d15daead101586ac8e.tar.gz | |
Parser: revert some error messages to what they were before 7.10
Among doing other things, Phab:D201 (bc2289e13d9586be087bd8136943dc35a0130c88)
tried to improve the error messages thrown by the parser. For example a missing
else clause now prints "parse error in if statement: else clause empty" instead
of "parse error (possibly incorrect indentation or mismatched brackets)".
Some error messages got much worse however (see tests), and the result seems to
be a net negative. Although not entirely satisfactory, this commits therefore
reverts those parser changes.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D1309
GHC Trac Issues: #10498
Diffstat (limited to 'compiler/parser')
| -rw-r--r-- | compiler/parser/Parser.y | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 7079a949f1..9245deb459 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -2182,37 +2182,6 @@ exp10 :: { LHsExpr RdrName } -- hdaume: core annotation | fexp { $1 } - -- parsing error messages go below here - | '\\' apat apats opt_asig '->' error {% parseErrorSDoc (combineLocs $1 $5) $ text - "parse error in lambda: no expression after '->'" - } - | '\\' error {% parseErrorSDoc (getLoc $1) $ text - "parse error: naked lambda expression '\'" - } - | 'let' binds 'in' error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in let binding: missing expression after 'in'" - } - | 'let' binds error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in let binding: missing required 'in'" - } - | 'let' error {% parseErrorSDoc (getLoc $1) $ text - "parse error: naked let binding" - } - | 'if' exp optSemi 'then' exp optSemi - 'else' error {% hintIf (combineLocs $1 $5) "else clause empty" } - | 'if' exp optSemi 'then' exp optSemi error {% hintIf (combineLocs $1 $5) "missing required else clause" } - | 'if' exp optSemi 'then' error {% hintIf (combineLocs $1 $2) "then clause empty" } - | 'if' exp optSemi error {% hintIf (combineLocs $1 $2) "missing required then and else clauses" } - | 'if' error {% hintIf (getLoc $1) "naked if statement" } - | 'case' exp 'of' error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in case statement: missing list after '->'" - } - | 'case' exp error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in case statement: missing required 'of'" - } - | 'case' error {% parseErrorSDoc (getLoc $1) $ text - "parse error: naked case statement" - } optSemi :: { ([Located a],Bool) } : ';' { ([$1],True) } | {- empty -} { ([],False) } |
