Commit 1ed54200 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Standalone deriving wibbles: keyword is 'derive' not 'derived'; and add flag documentation

parent 3de26aa3
......@@ -389,7 +389,7 @@ data Token
| ITdata
| ITdefault
| ITderiving
| ITderived
| ITderive
| ITdo
| ITelse
| IThiding
......@@ -544,7 +544,7 @@ isSpecial :: Token -> Bool
-- not as a keyword.
isSpecial ITas = True
isSpecial IThiding = True
isSpecial ITderived = True
isSpecial ITderive = True
isSpecial ITqualified = True
isSpecial ITforall = True
isSpecial ITexport = True
......@@ -576,7 +576,7 @@ reservedWordsFM = listToUFM $
( "data", ITdata, 0 ),
( "default", ITdefault, 0 ),
( "deriving", ITderiving, 0 ),
( "derived", ITderived, 0 ),
( "derive", ITderive, 0 ),
( "do", ITdo, 0 ),
( "else", ITelse, 0 ),
( "hiding", IThiding, 0 ),
......
......@@ -178,7 +178,7 @@ incorrect.
'data' { L _ ITdata }
'default' { L _ ITdefault }
'deriving' { L _ ITderiving }
'derived' { L _ ITderived }
'derive' { L _ ITderive }
'do' { L _ ITdo }
'else' { L _ ITelse }
'hiding' { L _ IThiding }
......@@ -740,7 +740,7 @@ tycl_hdr :: { Located (LHsContext RdrName,
-- Glasgow extension: stand-alone deriving declarations
stand_alone_deriving :: { LDerivDecl RdrName }
: 'derived' 'instance' inst_type {% checkDerivDecl (LL (DerivDecl $3)) }
: 'derive' 'instance' inst_type {% checkDerivDecl (LL (DerivDecl $3)) }
-----------------------------------------------------------------------------
-- Nested declarations
......@@ -1738,7 +1738,7 @@ special_id
: 'as' { L1 FSLIT("as") }
| 'qualified' { L1 FSLIT("qualified") }
| 'hiding' { L1 FSLIT("hiding") }
| 'derived' { L1 FSLIT("derived") }
| 'derive' { L1 FSLIT("derive") }
| 'export' { L1 FSLIT("export") }
| 'label' { L1 FSLIT("label") }
| 'dynamic' { L1 FSLIT("dynamic") }
......
......@@ -2069,7 +2069,7 @@ the standard method is used or the one described here.)
<title>Stand-alone deriving declarations</title>
<para>
GHC now allows stand-alone <literal>deriving</literal> declarations:
GHC now allows stand-alone <literal>deriving</literal> declarations, enabled by <literal>-fglasgow-exts</literal>:
<programlisting>
data Foo a = Bar a | Baz String
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment