diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-07-27 10:45:11 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-07-27 13:59:37 +0100 |
commit | 862b6d0616add7cec2a38b566fa7aa04a6ab2328 (patch) | |
tree | 6bc8a68c31857cdc486f9f86384c67cf9766f1a9 /compiler/parser/Parser.y.pp | |
parent | cf8fba957d86a291eea971ef12d3ba76ffcfef13 (diff) | |
download | haskell-862b6d0616add7cec2a38b566fa7aa04a6ab2328.tar.gz |
Use OrdLists when parsing export lists
No functional changes
Diffstat (limited to 'compiler/parser/Parser.y.pp')
-rw-r--r-- | compiler/parser/Parser.y.pp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index 1545aa27f4..af297531e2 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -469,34 +469,34 @@ header_body2 :: { [LImportDecl RdrName] } -- The Export List maybeexports :: { Maybe [LIE RdrName] } - : '(' exportlist ')' { Just $2 } + : '(' exportlist ')' { Just (fromOL $2) } | {- empty -} { Nothing } -exportlist :: { [LIE RdrName] } - : expdoclist ',' expdoclist { $1 ++ $3 } +exportlist :: { OrdList (LIE RdrName) } + : expdoclist ',' expdoclist { $1 `appOL` $3 } | exportlist1 { $1 } -exportlist1 :: { [LIE RdrName] } - : expdoclist export expdoclist ',' exportlist1 { $1 ++ ($2 : $3) ++ $5 } - | expdoclist export expdoclist { $1 ++ ($2 : $3) } +exportlist1 :: { OrdList (LIE RdrName) } + : expdoclist export expdoclist ',' exportlist1 { $1 `appOL` $2 `appOL` $3 `appOL` $5 } + | expdoclist export expdoclist { $1 `appOL` $2 `appOL` $3 } | expdoclist { $1 } -expdoclist :: { [LIE RdrName] } - : exp_doc expdoclist { $1 : $2 } - | {- empty -} { [] } +expdoclist :: { OrdList (LIE RdrName) } + : exp_doc expdoclist { $1 `appOL` $2 } + | {- empty -} { nilOL } -exp_doc :: { LIE RdrName } - : docsection { L1 (case (unLoc $1) of (n, doc) -> IEGroup n doc) } - | docnamed { L1 (IEDocNamed ((fst . unLoc) $1)) } - | docnext { L1 (IEDoc (unLoc $1)) } +exp_doc :: { OrdList (LIE RdrName) } + : docsection { unitOL (L1 (case (unLoc $1) of (n, doc) -> IEGroup n doc)) } + | docnamed { unitOL (L1 (IEDocNamed ((fst . unLoc) $1))) } + | docnext { unitOL (L1 (IEDoc (unLoc $1))) } -- No longer allow things like [] and (,,,) to be exported -- They are built in syntax, always available -export :: { LIE RdrName } - : qcname_ext export_subspec { LL (mkModuleImpExp (unLoc $1) - (unLoc $2)) } - | 'module' modid { LL (IEModuleContents (unLoc $2)) } +export :: { OrdList (LIE RdrName) } + : qcname_ext export_subspec { unitOL (LL (mkModuleImpExp (unLoc $1) + (unLoc $2))) } + | 'module' modid { unitOL (LL (IEModuleContents (unLoc $2))) } export_subspec :: { Located ImpExpSubSpec } : {- empty -} { L0 ImpExpAbs } @@ -563,8 +563,8 @@ maybeimpspec :: { Located (Maybe (Bool, [LIE RdrName])) } | {- empty -} { noLoc Nothing } impspec :: { Located (Bool, [LIE RdrName]) } - : '(' exportlist ')' { LL (False, $2) } - | 'hiding' '(' exportlist ')' { LL (True, $3) } + : '(' exportlist ')' { LL (False, fromOL $2) } + | 'hiding' '(' exportlist ')' { LL (True, fromOL $3) } ----------------------------------------------------------------------------- -- Fixity Declarations |