summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2011-11-29 02:09:28 +0100
committerDavid Waern <david.waern@gmail.com>2011-11-29 02:09:28 +0100
commite26443e75fdf33301df22d6da4911e888bb10282 (patch)
tree73bf733972ee973e0d5011bcd94c96a908753f56 /compiler/parser
parentfdf98d6255deba9582dd475e6953b1bb49fba660 (diff)
parent36f8cabecd5a8320ee174abb56e73841a5cbc9c7 (diff)
downloadhaskell-e26443e75fdf33301df22d6da4911e888bb10282.tar.gz
Merge branch 'master' of http://darcs.haskell.org/ghc
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Lexer.x5
-rw-r--r--compiler/parser/Parser.y.pp4
2 files changed, 9 insertions, 0 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index ea01070c94..f235465758 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -457,6 +457,7 @@ data Token
| ITunsafe
| ITstdcallconv
| ITccallconv
+ | ITcapiconv
| ITprimcallconv
| ITmdo
| ITfamily
@@ -642,6 +643,7 @@ reservedWordsFM = listToUFM $
( "unsafe", ITunsafe, bit ffiBit),
( "stdcall", ITstdcallconv, bit ffiBit),
( "ccall", ITccallconv, bit ffiBit),
+ ( "capi", ITcapiconv, bit cApiFfiBit),
( "prim", ITprimcallconv, bit ffiBit),
( "rec", ITrec, bit recBit),
@@ -1754,6 +1756,8 @@ ffiBit :: Int
ffiBit= 0
interruptibleFfiBit :: Int
interruptibleFfiBit = 1
+cApiFfiBit :: Int
+cApiFfiBit = 2
parrBit :: Int
parrBit = 3
arrowsBit :: Int
@@ -1879,6 +1883,7 @@ mkPState flags buf loc =
where
bitmap = ffiBit `setBitIf` xopt Opt_ForeignFunctionInterface flags
.|. interruptibleFfiBit `setBitIf` xopt Opt_InterruptibleFFI flags
+ .|. cApiFfiBit `setBitIf` xopt Opt_CApiFFI flags
.|. parrBit `setBitIf` xopt Opt_ParallelArrays flags
.|. arrowsBit `setBitIf` xopt Opt_Arrows flags
.|. thBit `setBitIf` xopt Opt_TemplateHaskell flags
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index de15f1cf2f..8a57504e68 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -244,6 +244,7 @@ incorrect.
'family' { L _ ITfamily }
'stdcall' { L _ ITstdcallconv }
'ccall' { L _ ITccallconv }
+ 'capi' { L _ ITcapiconv }
'prim' { L _ ITprimcallconv }
'proc' { L _ ITproc } -- for arrow notation extension
'rec' { L _ ITrec } -- for arrow notation extension
@@ -922,6 +923,7 @@ fdecl : 'import' callconv safety fspec
callconv :: { CCallConv }
: 'stdcall' { StdCallConv }
| 'ccall' { CCallConv }
+ | 'capi' { CApiConv }
| 'prim' { PrimCallConv}
safety :: { Safety }
@@ -1394,6 +1396,7 @@ scc_annot :: { Located FastString }
: '_scc_' STRING {% (addWarning Opt_WarnWarningsDeprecations (getLoc $1) (text "_scc_ is deprecated; use an SCC pragma instead")) >>= \_ ->
( do scc <- getSCC $2; return $ LL scc ) }
| '{-# SCC' STRING '#-}' {% do scc <- getSCC $2; return $ LL scc }
+ | '{-# SCC' VARID '#-}' { LL (getVARID $2) }
hpc_annot :: { Located (FastString,(Int,Int),(Int,Int)) }
: '{-# GENERATED' STRING INTEGER ':' INTEGER '-' INTEGER ':' INTEGER '#-}'
@@ -1944,6 +1947,7 @@ special_id
| 'dynamic' { L1 (fsLit "dynamic") }
| 'stdcall' { L1 (fsLit "stdcall") }
| 'ccall' { L1 (fsLit "ccall") }
+ | 'capi' { L1 (fsLit "capi") }
| 'prim' { L1 (fsLit "prim") }
| 'group' { L1 (fsLit "group") }