From 7217f562ed08b7ef8a702065d437f7b6366aea88 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 1 Dec 2010 18:11:17 +0000 Subject: [PATCH] Remove NewQualifiedOperators The extension was rejected by Haskell', and deprecated in 7.0. --- compiler/main/DynFlags.hs | 5 +---- compiler/parser/Lexer.x | 13 ++----------- docs/users_guide/flags.xml | 7 ------- docs/users_guide/glasgow_exts.xml | 37 ------------------------------------- 4 files changed, 3 insertions(+), 59 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index df51f94..5cd0361 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -357,7 +357,6 @@ data ExtensionFlag | Opt_ImpredicativeTypes | Opt_TypeOperators | Opt_PackageImports - | Opt_NewQualifiedOperators | Opt_ExplicitForAll | Opt_AlternativeLayoutRule | Opt_AlternativeLayoutRuleTransitional @@ -1627,9 +1626,7 @@ xFlags = [ ( "OverlappingInstances", Opt_OverlappingInstances, nop ), ( "UndecidableInstances", Opt_UndecidableInstances, nop ), ( "IncoherentInstances", Opt_IncoherentInstances, nop ), - ( "PackageImports", Opt_PackageImports, nop ), - ( "NewQualifiedOperators", Opt_NewQualifiedOperators, - \_ -> deprecate "The new qualified operator syntax was rejected by Haskell'" ) + ( "PackageImports", Opt_PackageImports, nop ) ] defaultFlags :: [DynFlag] diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 1118215..2d4a225 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -369,10 +369,8 @@ $tab+ { warn Opt_WarnTabs (text "Warning: Tab character") } -- ToDo: - move `var` and (sym) into lexical syntax? -- - remove backquote from $special? <0> { - @qual @varsym / { ifExtension oldQualOps } { idtoken qvarsym } - @qual @consym / { ifExtension oldQualOps } { idtoken qconsym } - @qual \( @varsym \) / { ifExtension newQualOps } { idtoken prefixqvarsym } - @qual \( @consym \) / { ifExtension newQualOps } { idtoken prefixqconsym } + @qual @varsym { idtoken qvarsym } + @qual @consym { idtoken qconsym } @varsym { varsym } @consym { consym } } @@ -1770,8 +1768,6 @@ inRulePragBit :: Int inRulePragBit = 19 rawTokenStreamBit :: Int rawTokenStreamBit = 20 -- producing a token stream with all comments included -newQualOpsBit :: Int -newQualOpsBit = 21 -- Haskell' qualified operator syntax, e.g. Prelude.(+) recBit :: Int recBit = 22 -- rec alternativeLayoutRuleBit :: Int @@ -1817,10 +1813,6 @@ qqEnabled flags = testBit flags qqBit -- inRulePrag flags = testBit flags inRulePragBit rawTokenStreamEnabled :: Int -> Bool rawTokenStreamEnabled flags = testBit flags rawTokenStreamBit -newQualOps :: Int -> Bool -newQualOps flags = testBit flags newQualOpsBit -oldQualOps :: Int -> Bool -oldQualOps flags = not (newQualOps flags) alternativeLayoutRule :: Int -> Bool alternativeLayoutRule flags = testBit flags alternativeLayoutRuleBit relaxedLayout :: Int -> Bool @@ -1878,7 +1870,6 @@ mkPState flags buf loc = .|. datatypeContextsBit `setBitIf` xopt Opt_DatatypeContexts flags .|. transformComprehensionsBit `setBitIf` xopt Opt_TransformListComp flags .|. rawTokenStreamBit `setBitIf` dopt Opt_KeepRawTokenStream flags - .|. newQualOpsBit `setBitIf` xopt Opt_NewQualifiedOperators flags .|. alternativeLayoutRuleBit `setBitIf` xopt Opt_AlternativeLayoutRule flags .|. relaxedLayoutBit `setBitIf` xopt Opt_RelaxedLayout flags .|. nondecreasingIndentationBit `setBitIf` xopt Opt_NondecreasingIndentation flags diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index b6ace8d..c8e5dfc 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -832,13 +832,6 @@ - - Enable new - qualified operator syntax - dynamic - - - Enable explicit universal quantification. Implied by , diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index a29e747..e57b294 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -450,43 +450,6 @@ Indeed, the bindings can even be recursive. - - New qualified operator syntax - - A new syntax for referencing qualified operators is - planned to be introduced by Haskell', and is enabled in GHC - with - the - option. In the new syntax, the prefix form of a qualified - operator is - written module.(symbol) - (without NewQualifiedOperators this would - be (module.symbol)), - and the infix form is - written `module.(symbol)` - (without NewQualifiedOperators this would - be `module.symbol`. - For example: - - add x y = Prelude.(+) x y - subtract y = (`Prelude.(-)` y) - - The new form of qualified operators is intended to regularise - the syntax by eliminating odd cases - like Prelude... For example, - when NewQualifiedOperators is on, it is possible to - write the enumerated sequence [Monday..] - without spaces, whereas without NewQualifiedOperators this would be a - reference to the operator ‘.‘ - from module Monday. - - When is on, the old - syntax for qualified operators is not accepted, so this - option may cause existing code to break. - - - - -- 1.7.10.4