summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-19 10:28:01 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-07 18:36:49 -0400
commit255418da5d264fb2758bc70925adb2094f34adc3 (patch)
tree39e3d7f84571e750f2a087c1bc2ab87198e9b147 /compiler/parser
parent3d2991f8b4c1b686323b2c9452ce845a60b8d94c (diff)
downloadhaskell-255418da5d264fb2758bc70925adb2094f34adc3.tar.gz
Modules: type-checker (#13009)
Update Haddock submodule
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Lexer.x2
-rw-r--r--compiler/parser/Parser.y15
2 files changed, 6 insertions, 11 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index a99a62913e..1536b85bca 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -940,7 +940,7 @@ One might think that we wish to treat 'family' and 'role' as regular old
varids whenever -XTypeFamilies and -XRoleAnnotations are off, respectively.
But, there is no need to do so. These pseudo-keywords are not stolen syntax:
they are only used after the keyword 'type' at the top-level, where varids are
-not allowed. Furthermore, checks further downstream (TcTyClsDecls) ensure that
+not allowed. Furthermore, checks further downstream (GHC.Tc.TyCl) ensure that
type families and role annotations are never declared without their extensions
on. In fact, by unconditionally lexing these pseudo-keywords as special, we
can get better error messages.
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index e87cad6dae..842a912b0e 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -44,10 +44,9 @@ import Control.Monad ( mplus )
import Control.Applicative ((<$))
import qualified Prelude
--- compiler/hsSyn
+-- compiler
import GHC.Hs
--- compiler/main
import GHC.Driver.Phases ( HscSource(..) )
import GHC.Driver.Types ( IsBootInterface, WarningTxt(..) )
import GHC.Driver.Session
@@ -60,6 +59,8 @@ import BooleanFormula ( BooleanFormula(..), LBooleanFormula(..), mkTrue )
import FastString
import Maybes ( isJust, orElse )
import Outputable
+import Util ( looksLikePackageName, fstOf3, sndOf3, thdOf3 )
+import GhcPrelude
-- compiler/basicTypes
import GHC.Types.Name.Reader
@@ -68,8 +69,8 @@ import GHC.Core.DataCon ( DataCon, dataConName )
import GHC.Types.SrcLoc
import GHC.Types.Module
import GHC.Types.Basic
+import GHC.Types.ForeignCall
--- compiler/types
import GHC.Core.Type ( funTyCon )
import GHC.Core.Class ( FunDep )
@@ -79,19 +80,13 @@ import Lexer
import HaddockUtils
import ApiAnnotation
--- compiler/typecheck
-import TcEvidence ( emptyTcEvBinds )
+import GHC.Tc.Types.Evidence ( emptyTcEvBinds )
-- compiler/prelude
-import GHC.Types.ForeignCall
import TysPrim ( eqPrimTyCon )
import TysWiredIn ( unitTyCon, unitDataCon, tupleTyCon, tupleDataCon, nilDataCon,
unboxedUnitTyCon, unboxedUnitDataCon,
listTyCon_RDR, consDataCon_RDR, eqTyCon_RDR )
-
--- compiler/utils
-import Util ( looksLikePackageName, fstOf3, sndOf3, thdOf3 )
-import GhcPrelude
}
%expect 232 -- shift/reduce conflicts