summaryrefslogtreecommitdiff
path: root/compiler/parser/Parser.y
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2016-02-23 09:51:50 -0500
committerRichard Eisenberg <eir@cis.upenn.edu>2016-03-14 21:44:17 -0400
commit972730cc42a419b8cd148abaa927e03415da3a68 (patch)
treebcafe558128635cf05f679caf6270e9918dbe74d /compiler/parser/Parser.y
parent35d37ff8a0bb9f64f347c8e4b6a24d49fd08c9dc (diff)
downloadhaskell-972730cc42a419b8cd148abaa927e03415da3a68.tar.gz
Refactor visible type application.
This replaces the old HsType and HsTypeOut constructors with HsAppType and HsAppTypeOut, leading to some simplification. (This refactoring addresses #11329.) This also fixes #11456, which stumbled over HsType (which is not an expression). test case: ghci/scripts/T11456 [skip ci]
Diffstat (limited to 'compiler/parser/Parser.y')
-rw-r--r--compiler/parser/Parser.y11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index dead15bbb3..a640bcb849 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -2241,10 +2241,12 @@ hpc_annot :: { Located ( (([AddAnn],SourceText),(StringLiteral,(Int,Int),(Int,In
}
fexp :: { LHsExpr RdrName }
- : fexp aexp { sLL $1 $> $ HsApp $1 $2 }
- | 'static' aexp {% ams (sLL $1 $> $ HsStatic $2)
- [mj AnnStatic $1] }
- | aexp { $1 }
+ : fexp aexp { sLL $1 $> $ HsApp $1 $2 }
+ | fexp TYPEAPP atype {% ams (sLL $1 $> $ HsAppType $1 (mkHsWildCardBndrs $3))
+ [mj AnnAt $2] }
+ | 'static' aexp {% ams (sLL $1 $> $ HsStatic $2)
+ [mj AnnStatic $1] }
+ | aexp { $1 }
aexp :: { LHsExpr RdrName }
: qvar '@' aexp {% ams (sLL $1 $> $ EAsPat $1 $3) [mj AnnAt $2] }
@@ -2252,7 +2254,6 @@ aexp :: { LHsExpr RdrName }
-- Note [Lexing type applications] in Lexer.x
| '~' aexp {% ams (sLL $1 $> $ ELazyPat $2) [mj AnnTilde $1] }
- | TYPEAPP atype {% ams (sLL $1 $> $ HsType (mkHsWildCardBndrs $2)) [mj AnnAt $1] }
| aexp1 { $1 }
aexp1 :: { LHsExpr RdrName }