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:
35be7d9
)
[project @ 2002-10-11 08:48:13 by simonpj]
author
simonpj
<unknown>
Fri, 11 Oct 2002 08:48:13 +0000
(08:48 +0000)
committer
simonpj
<unknown>
Fri, 11 Oct 2002 08:48:13 +0000
(08:48 +0000)
wibbles
ghc/compiler/parser/Parser.y
patch
|
blob
|
history
diff --git
a/ghc/compiler/parser/Parser.y
b/ghc/compiler/parser/Parser.y
index
d09226a
..
851deb7
100644
(file)
--- a/
ghc/compiler/parser/Parser.y
+++ b/
ghc/compiler/parser/Parser.y
@@
-1,6
+1,6
@@
{- -*-haskell-*-
-----------------------------------------------------------------------------
{- -*-haskell-*-
-----------------------------------------------------------------------------
-$Id: Parser.y,v 1.108 2002/10/10 15:14:37 sof Exp $
+$Id: Parser.y,v 1.109 2002/10/11 08:48:13 simonpj Exp $
Haskell grammar.
Haskell grammar.
@@
-413,7
+413,7
@@
topdecl :: { RdrBinding }
in RdrHsDecl (InstD (InstDecl $3 binds sigs Nothing $1)) }
| srcloc 'default' '(' comma_types0 ')' { RdrHsDecl (DefD (DefaultDecl $4 $1)) }
| 'foreign' fdecl { RdrHsDecl $2 }
in RdrHsDecl (InstD (InstDecl $3 binds sigs Nothing $1)) }
| srcloc 'default' '(' comma_types0 ')' { RdrHsDecl (DefD (DefaultDecl $4 $1)) }
| 'foreign' fdecl { RdrHsDecl $2 }
- | '{-# DEPRECATED' deprecations '#-}' { RdrBindings $2 }
+ | '{-# DEPRECATED' deprecations '#-}' { RdrBindings (reverse $2) }
| '{-# RULES' rules '#-}' { RdrBindings (reverse $2) }
| srcloc '$(' exp ')' { RdrHsDecl (SpliceD (SpliceDecl $3 $1)) }
| decl { $1 }
| '{-# RULES' rules '#-}' { RdrBindings (reverse $2) }
| srcloc '$(' exp ')' { RdrHsDecl (SpliceD (SpliceDecl $3 $1)) }
| decl { $1 }
@@
-487,7
+487,7
@@
letbinds :: { RdrNameHsExpr -> RdrNameHsExpr }
-----------------------------------------------------------------------------
-- Transformation Rules
-----------------------------------------------------------------------------
-- Transformation Rules
-rules :: { [RdrBinding] }
+rules :: { [RdrBinding] } -- Reversed
: rules ';' rule { $3 : $1 }
| rules ';' { $1 }
| rule { [$1] }
: rules ';' rule { $3 : $1 }
| rules ';' { $1 }
| rule { [$1] }
@@
-522,10
+522,11
@@
rule_var :: { RdrNameRuleBndr }
| '(' varid '::' ctype ')' { RuleBndrSig $2 $4 }
-----------------------------------------------------------------------------
| '(' varid '::' ctype ')' { RuleBndrSig $2 $4 }
-----------------------------------------------------------------------------
--- Deprecations
+-- Deprecations (c.f. rules)
-deprecations :: { [RdrBinding] }
- : deprecation ';' deprecations { $1 : $3 }
+deprecations :: { [RdrBinding] } -- Reversed
+ : deprecations ';' deprecation { $3 : $1 }
+ | deprecations ';' { $1 }
| deprecation { [$1] }
| {- empty -} { [] }
| deprecation { [$1] }
| {- empty -} { [] }