summaryrefslogtreecommitdiff
path: root/compiler/parser/Parser.y.pp
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-06-20 17:06:13 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2011-06-20 17:06:13 +0100
commit2e2651da55f577db59f274b99a71d8a50bc7a961 (patch)
tree645932fa4f21733b1837d508b104a06de2782d6e /compiler/parser/Parser.y.pp
parent3b545c4edfd4cf61ff6dc7af18fde26faf4d7c4b (diff)
parent089cc2928c8c0e8107448e62b29b6392a1abe30f (diff)
downloadhaskell-2e2651da55f577db59f274b99a71d8a50bc7a961.tar.gz
Merge branch 'master' of http://darcs.haskell.org/ghc
Diffstat (limited to 'compiler/parser/Parser.y.pp')
-rw-r--r--compiler/parser/Parser.y.pp10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index b663ac2aba..bb82aaa2d1 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -500,13 +500,17 @@ importdecls :: { [LImportDecl RdrName] }
| {- empty -} { [] }
importdecl :: { LImportDecl RdrName }
- : 'import' maybe_src optqualified maybe_pkg modid maybeas maybeimpspec
- { L (comb4 $1 $5 $6 $7) (ImportDecl $5 $4 $2 $3 (unLoc $6) (unLoc $7)) }
+ : 'import' maybe_src maybe_safe optqualified maybe_pkg modid maybeas maybeimpspec
+ { L (comb4 $1 $6 $7 $8) (ImportDecl $6 $5 $2 $3 $4 (unLoc $7) (unLoc $8)) }
maybe_src :: { IsBootInterface }
: '{-# SOURCE' '#-}' { True }
| {- empty -} { False }
+maybe_safe :: { Bool }
+ : 'safe' { True }
+ | {- empty -} { False }
+
maybe_pkg :: { Maybe FastString }
: STRING { Just (getSTRING $1) }
| {- empty -} { Nothing }
@@ -1241,7 +1245,7 @@ sigdecl :: { Located (OrdList (LHsDecl RdrName)) }
{% do s <- checkValSig $1 $3
; return (LL $ unitOL (LL $ SigD s)) }
| var ',' sig_vars '::' sigtypedoc
- { LL $ toOL [ LL $ SigD (TypeSig n $5) | n <- $1 : unLoc $3 ] }
+ { LL $ toOL [ LL $ SigD (TypeSig ($1 : unLoc $3) $5) ] }
| infix prec ops { LL $ toOL [ LL $ SigD (FixSig (FixitySig n (Fixity $2 (unLoc $1))))
| n <- unLoc $3 ] }
| '{-# INLINE' activation qvar '#-}'