summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/parser/Parser.y24
1 files changed, 4 insertions, 20 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index e61ff31844..276fcb1c5b 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -1320,36 +1320,20 @@ at_decl_inst :: { LInstDecl GhcPs }
(mj AnnType $1:$2++(fst $ unLoc $3)) }
-- data/newtype instance declaration, with optional 'instance' keyword
- -- (can't use opt_instance because you get reduce/reduce errors)
- | data_or_newtype capi_ctype tycl_hdr_inst constrs maybe_derivings
- {% amms (mkDataFamInst (comb4 $1 $3 $4 $5) (snd $ unLoc $1) $2 (snd $ unLoc $3)
- Nothing (reverse (snd $ unLoc $4))
- (fmap reverse $5))
- ((fst $ unLoc $1):(fst $ unLoc $3) ++ (fst $ unLoc $4)) }
-
- | data_or_newtype 'instance' capi_ctype tycl_hdr_inst constrs maybe_derivings
+ | data_or_newtype opt_instance capi_ctype tycl_hdr_inst constrs maybe_derivings
{% amms (mkDataFamInst (comb4 $1 $4 $5 $6) (snd $ unLoc $1) $3 (snd $ unLoc $4)
Nothing (reverse (snd $ unLoc $5))
(fmap reverse $6))
- ((fst $ unLoc $1):mj AnnInstance $2:(fst $ unLoc $4)++(fst $ unLoc $5)) }
+ ((fst $ unLoc $1):$2++(fst $ unLoc $4)++(fst $ unLoc $5)) }
-- GADT instance declaration, with optional 'instance' keyword
- -- (can't use opt_instance because you get reduce/reduce errors)
- | data_or_newtype capi_ctype tycl_hdr_inst opt_kind_sig
- gadt_constrlist
- maybe_derivings
- {% amms (mkDataFamInst (comb4 $1 $3 $5 $6) (snd $ unLoc $1) $2
- (snd $ unLoc $3) (snd $ unLoc $4) (snd $ unLoc $5)
- (fmap reverse $6))
- ((fst $ unLoc $1):(fst $ unLoc $3)++(fst $ unLoc $4)++(fst $ unLoc $5)) }
-
- | data_or_newtype 'instance' capi_ctype tycl_hdr_inst opt_kind_sig
+ | data_or_newtype opt_instance capi_ctype tycl_hdr_inst opt_kind_sig
gadt_constrlist
maybe_derivings
{% amms (mkDataFamInst (comb4 $1 $4 $6 $7) (snd $ unLoc $1) $3
(snd $ unLoc $4) (snd $ unLoc $5) (snd $ unLoc $6)
(fmap reverse $7))
- ((fst $ unLoc $1):mj AnnInstance $2:(fst $ unLoc $4)++(fst $ unLoc $5)++(fst $ unLoc $6)) }
+ ((fst $ unLoc $1):$2++(fst $ unLoc $4)++(fst $ unLoc $5)++(fst $ unLoc $6)) }
data_or_newtype :: { Located (AddAnn, NewOrData) }
: 'data' { sL1 $1 (mj AnnData $1,DataType) }