[commit: ghc] master: Correct the message displayed for syntax error (#12146) (34085b5)

git at git.haskell.org git at git.haskell.org
Thu Jul 7 15:11:28 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/34085b501d99bd0b185a4addb0577330fa1f8356/ghc

>---------------------------------------------------------------

commit 34085b501d99bd0b185a4addb0577330fa1f8356
Author: Aditya <adityadivekar03 at gmail.com>
Date:   Sat Jun 25 19:51:36 2016 +0530

    Correct the message displayed for syntax error (#12146)


>---------------------------------------------------------------

34085b501d99bd0b185a4addb0577330fa1f8356
 compiler/rename/RnSource.hs                     | 4 ++--
 testsuite/tests/ghci/scripts/T1914.stderr       | 4 ++--
 testsuite/tests/ghci/scripts/T6106.stderr       | 4 ++--
 testsuite/tests/rename/should_fail/T4042.stderr | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs
index 4790ada..67cf7fd 100644
--- a/compiler/rename/RnSource.hs
+++ b/compiler/rename/RnSource.hs
@@ -2114,8 +2114,8 @@ add gp loc (SpliceD splice@(SpliceDecl _ flag)) ds
 
        ; return (gp, Just (splice, ds)) }
   where
-    badImplicitSplice = text "Parse error: naked expression at top level"
-                     $$ text "Perhaps you intended to use TemplateHaskell"
+    badImplicitSplice = text "Parse error: module header, import declaration"
+                     $$ text "or top-level declaration expected."
 
 -- Class declarations: pull out the fixity signatures to the top
 add gp@(HsGroup {hs_tyclds = ts, hs_fixds = fs}) l (TyClD d) ds
diff --git a/testsuite/tests/ghci/scripts/T1914.stderr b/testsuite/tests/ghci/scripts/T1914.stderr
index b6357f2..6dd83fa 100644
--- a/testsuite/tests/ghci/scripts/T1914.stderr
+++ b/testsuite/tests/ghci/scripts/T1914.stderr
@@ -1,4 +1,4 @@
 
 T1914A.hs:1:38:
-    Parse error: naked expression at top level
-    Perhaps you intended to use TemplateHaskell
+    Parse error: module header, import declaration
+    or top-level declaration expected.
diff --git a/testsuite/tests/ghci/scripts/T6106.stderr b/testsuite/tests/ghci/scripts/T6106.stderr
index ad92524..7023e2f 100644
--- a/testsuite/tests/ghci/scripts/T6106.stderr
+++ b/testsuite/tests/ghci/scripts/T6106.stderr
@@ -1,4 +1,4 @@
 
 T6106.hs:1:1:
-    Parse error: naked expression at top level
-    Perhaps you intended to use TemplateHaskell
+    Parse error: module header, import declaration
+    or top-level declaration expected.
diff --git a/testsuite/tests/rename/should_fail/T4042.stderr b/testsuite/tests/rename/should_fail/T4042.stderr
index a00cec6..65d737b 100644
--- a/testsuite/tests/rename/should_fail/T4042.stderr
+++ b/testsuite/tests/rename/should_fail/T4042.stderr
@@ -1,4 +1,4 @@
 
 T4042.hs:6:1:
-    Parse error: naked expression at top level
-    Perhaps you intended to use TemplateHaskell
+    Parse error: module header, import declaration
+    or top-level declaration expected.



More information about the ghc-commits mailing list