projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e70246a
)
fix export/import list parsing (allow (,)), and remove unnecessary reverses
author
Simon Marlow
<simonmar@microsoft.com>
Mon, 21 Aug 2006 10:26:33 +0000
(10:26 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Mon, 21 Aug 2006 10:26:33 +0000
(10:26 +0000)
compiler/parser/Parser.y.pp
patch
|
blob
|
history
diff --git
a/compiler/parser/Parser.y.pp
b/compiler/parser/Parser.y.pp
index
1469a66
..
1ad8d5f
100644
(file)
--- a/
compiler/parser/Parser.y.pp
+++ b/
compiler/parser/Parser.y.pp
@@
-342,7
+342,11
@@
maybeexports :: { Maybe [LIE RdrName] }
: '(' exportlist ')' { Just $2 }
| {- empty -} { Nothing }
: '(' exportlist ')' { Just $2 }
| {- empty -} { Nothing }
-exportlist :: { [LIE RdrName] }
+exportlist :: { [LIE RdrName] }
+ : ',' { [] }
+ | exportlist1 { $1 }
+
+exportlist1 :: { [LIE RdrName] }
: export { [$1] }
| export ',' exportlist { $1 : $3 }
| {- empty -} { [] }
: export { [$1] }
| export ',' exportlist { $1 : $3 }
| {- empty -} { [] }
@@
-398,8
+402,8
@@
maybeimpspec :: { Located (Maybe (Bool, [LIE RdrName])) }
| {- empty -} { noLoc Nothing }
impspec :: { Located (Bool, [LIE RdrName]) }
| {- empty -} { noLoc Nothing }
impspec :: { Located (Bool, [LIE RdrName]) }
- : '(' exportlist ')' { LL (False, reverse $2) }
- | 'hiding' '(' exportlist ')' { LL (True, reverse $3) }
+ : '(' exportlist ')' { LL (False, $2) }
+ | 'hiding' '(' exportlist ')' { LL (True, $3) }
-----------------------------------------------------------------------------
-- Fixity Declarations
-----------------------------------------------------------------------------
-- Fixity Declarations