diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2016-11-03 14:40:12 +0200 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2016-11-03 20:45:05 +0200 |
commit | f46bfeb8344e1818f42066c3dd9717f49e8b511b (patch) | |
tree | 7f90fe96ae6a66dd364f5d06bc030c4360f00b80 /compiler/parser/Parser.y | |
parent | ec22bacdd625b04d28228dd5522d59d0bc8b1152 (diff) | |
download | haskell-f46bfeb8344e1818f42066c3dd9717f49e8b511b.tar.gz |
API Annotations: make all ModuleName Located
Summary:
This also changes the backpack Renaming type to use a Maybe for the
renameTo field, to more accurately reflect the parsed source.
Updates haddock submodule to match AST changes
Test Plan: ./validate
Reviewers: ezyang, bgamari, austin
Reviewed By: bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2670
Diffstat (limited to 'compiler/parser/Parser.y')
-rw-r--r-- | compiler/parser/Parser.y | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index d72aabd2e7..2c90086c56 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -575,8 +575,8 @@ rns :: { OrdList LRenaming } | rn { unitOL $1 } rn :: { LRenaming } - : modid 'as' modid { sLL $1 $> $ Renaming (unLoc $1) (unLoc $3) } - | modid { sL1 $1 $ Renaming (unLoc $1) (unLoc $1) } + : modid 'as' modid { sLL $1 $> $ Renaming $1 (Just $3) } + | modid { sL1 $1 $ Renaming $1 Nothing } unitbody :: { OrdList (LHsUnitDecl PackageName) } : '{' unitdecls '}' { $2 } @@ -847,9 +847,9 @@ optqualified :: { ([AddAnn],Bool) } : 'qualified' { ([mj AnnQualified $1],True) } | {- empty -} { ([],False) } -maybeas :: { ([AddAnn],Located (Maybe ModuleName)) } - : 'as' modid { ([mj AnnAs $1,mj AnnVal $2] - ,sLL $1 $> (Just (unLoc $2))) } +maybeas :: { ([AddAnn],Located (Maybe (Located ModuleName))) } + : 'as' modid { ([mj AnnAs $1] + ,sLL $1 $> (Just $2)) } | {- empty -} { ([],noLoc Nothing) } maybeimpspec :: { Located (Maybe (Bool, Located [LIE RdrName])) } |