-{- Notes about the syntax of interface files
+{- Notes about the syntax of interface files -*-haskell-*-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The header
~~~~~~~~~~
'|}' { ITccurlybar } -- special symbols
'[' { ITobrack }
']' { ITcbrack }
+ '[:' { ITopabrack }
+ ':]' { ITcpabrack }
'(' { IToparen }
')' { ITcparen }
'(#' { IToubxparen }
-}
pragma :: { Maybe (ParseResult [HsIdInfo RdrName]) }
-pragma : src_loc PRAGMA { Just (parseIdInfo $2 PState{ bol = 0#, atbol = 1#,
- context = [],
- glasgow_exts = 1#,
- loc = $1 })
+pragma : src_loc PRAGMA { let exts = ExtFlags {glasgowExtsEF = True,
+ parrEF = True}
+ in
+ Just (parseIdInfo $2 (mkPState $1 exts))
}
-----------------------------------------------------------------------------
rules_and_deprecs_part :: { () -> ([RdrNameRuleDecl], IfaceDeprecs) }
rules_and_deprecs_part
: {- empty -} { \_ -> ([], Nothing) }
- | src_loc PRAGMA { \_ -> case parseRules $2 PState{ bol = 0#, atbol = 1#,
- context = [],
- glasgow_exts = 1#,
- loc = $1 } of
+ | src_loc PRAGMA { \_ -> let exts = ExtFlags {glasgowExtsEF = True,
+ parrEF = True}
+ in case parseRules $2 (mkPState $1 exts) of
POk _ rds -> rds
PFailed err -> pprPanic "Rules/Deprecations parse failed" err
}
| '(' types2 ')' { HsTupleTy (mkHsTupCon tcName Boxed $2) $2 }
| '(#' types0 '#)' { HsTupleTy (mkHsTupCon tcName Unboxed $2) $2 }
| '[' type ']' { HsListTy $2 }
+ | '[:' type ':]' { HsPArrTy $2 }
| '{' qcls_name atypes '}' { mkHsDictTy $2 $3 }
| '{' ipvar_name '::' type '}' { mkHsIParamTy $2 $4 }
| '(' type ')' { $2 }
| '(' types2 ')' { HsTupleTy (mkHsTupCon tcName Boxed $2) $2 }
| '(#' types0 '#)' { HsTupleTy (mkHsTupCon tcName Unboxed $2) $2 }
| '[' type ']' { HsListTy $2 }
+ | '[:' type ':]' { HsPArrTy $2 }
| '{' qcls_name atypes '}' { mkHsDictTy $2 $3 }
| '{' ipvar_name '::' type '}' { mkHsIParamTy $2 $4 }
| '(' type ')' { $2 }