From 1ed54200532d9a9b1b58ac914dae28c1ecb48699 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Tue, 2 Jan 2007 16:17:52 +0000 Subject: [PATCH] Standalone deriving wibbles: keyword is 'derive' not 'derived'; and add flag documentation --- compiler/parser/Lexer.x | 6 +++--- compiler/parser/Parser.y.pp | 6 +++--- docs/users_guide/glasgow_exts.xml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 316f21f..bb0fc1e 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -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 ), diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index 889e4ce..060eeac 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -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") } diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 29e7082..41bba18 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -2069,7 +2069,7 @@ the standard method is used or the one described here.) Stand-alone deriving declarations -GHC now allows stand-alone deriving declarations: +GHC now allows stand-alone deriving declarations, enabled by -fglasgow-exts: data Foo a = Bar a | Baz String -- 1.7.10.4