diff options
| author | Dr. ERDI Gergo <gergo@erdi.hu> | 2014-07-06 22:13:50 +0800 |
|---|---|---|
| committer | Dr. ERDI Gergo <gergo@erdi.hu> | 2014-07-29 11:34:41 +0200 |
| commit | 40e77740270ee3bc9d7241aa3fe9d4c6f1695859 (patch) | |
| tree | 693ce3735ec77f30f5442e61b9ab10b8ff6c62f1 /compiler/parser/Parser.y.pp | |
| parent | 12644c3c0216edfcff33266f4f250e0c52004352 (diff) | |
| download | haskell-40e77740270ee3bc9d7241aa3fe9d4c6f1695859.tar.gz | |
Add parser support for explicitly bidirectional pattern synonyms
Diffstat (limited to 'compiler/parser/Parser.y.pp')
| -rw-r--r-- | compiler/parser/Parser.y.pp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index 9321e03d87..72dfc88fa6 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -856,6 +856,16 @@ pattern_synonym_decl :: { LHsDecl RdrName } {% do { (name, args) <- splitPatSyn $2 ; return $ LL . ValD $ mkPatSynBind name args $4 Unidirectional }} + | 'pattern' pat '<-' pat where_decls + {% do { (name, args) <- splitPatSyn $2 + ; mg <- toPatSynMatchGroup name $5 + ; return $ LL . ValD $ + mkPatSynBind name args $4 (ExplicitBidirectional mg) + }} + +where_decls :: { Located (OrdList (LHsDecl RdrName)) } + : 'where' '{' decls '}' { $3 } + | 'where' vocurly decls close { $3 } vars0 :: { [Located RdrName] } : {- empty -} { [] } |
