diff options
Diffstat (limited to 'utils/genprimopcode')
-rw-r--r-- | utils/genprimopcode/Parser.y | 6 | ||||
-rw-r--r-- | utils/genprimopcode/Syntax.hs | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/utils/genprimopcode/Parser.y b/utils/genprimopcode/Parser.y index 51ca9ad6eb..cd712d7584 100644 --- a/utils/genprimopcode/Parser.y +++ b/utils/genprimopcode/Parser.y @@ -77,9 +77,9 @@ pOption : lowerName '=' false { OptionFalse $1 } | fixity '=' pInfix { OptionFixity $3 } pInfix :: { Maybe Fixity } -pInfix : infix integer { Just $ Fixity (show $2) $2 InfixN } - | infixl integer { Just $ Fixity (show $2) $2 InfixL } - | infixr integer { Just $ Fixity (show $2) $2 InfixR } +pInfix : infix integer { Just $ Fixity NoSourceText $2 InfixN } + | infixl integer { Just $ Fixity NoSourceText $2 InfixL } + | infixr integer { Just $ Fixity NoSourceText $2 InfixR } | nothing { Nothing } diff --git a/utils/genprimopcode/Syntax.hs b/utils/genprimopcode/Syntax.hs index 17c264d44a..b848863135 100644 --- a/utils/genprimopcode/Syntax.hs +++ b/utils/genprimopcode/Syntax.hs @@ -96,14 +96,18 @@ instance Show TyCon where -- Follow definitions of Fixity and FixityDirection in GHC --- The String exists so that it matches the SourceText field in +-- The SourceText exists so that it matches the SourceText field in -- BasicTypes.Fixity -data Fixity = Fixity String Int FixityDirection +data Fixity = Fixity SourceText Int FixityDirection deriving (Eq, Show) data FixityDirection = InfixN | InfixL | InfixR deriving (Eq, Show) +data SourceText = SourceText String + | NoSourceText + deriving (Eq,Show) + ------------------------------------------------------------------ -- Sanity checking ----------------------------------------------- ------------------------------------------------------------------ |