From 7abd5f7b78b12a20aac8fbb428d686452a952151 Mon Sep 17 00:00:00 2001 From: Bill Casarin Date: Sat, 21 Apr 2012 14:01:13 -0400 Subject: [PATCH 1/2] Fix for GHC 7.4.1, bump to v0.4 --- language-python.cabal | 22 +++++++++++----------- src/Language/Python/Common/LexerUtils.hs | 2 +- src/Language/Python/Common/Pretty.hs | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/language-python.cabal b/language-python.cabal index aa54307..65c7fb4 100644 --- a/language-python.cabal +++ b/language-python.cabal @@ -1,33 +1,33 @@ name: language-python -version: 0.3.2 +version: 0.4 cabal-version: >= 1.6 -synopsis: Parsing and pretty printing of Python code. -description: language-python is a Haskell library for lexical analysis, parsing - and pretty printing Python code. It supports versions 2.x and 3.x of Python. +synopsis: Parsing and pretty printing of Python code. +description: language-python is a Haskell library for lexical analysis, parsing + and pretty printing Python code. It supports versions 2.x and 3.x of Python. category: Language license: BSD3 license-file: LICENSE copyright: (c) 2008-2010 Bernard James Pope author: Bernard James Pope (Bernie Pope) maintainer: florbitous@gmail.com -homepage: http://github.com/bjpop/language-python +homepage: http://github.com/bjpop/language-python build-depends: base build-type: Simple stability: experimental -extra-source-files: src/Language/Python/Version3/Parser/Parser.y - src/Language/Python/Version3/Parser/Lexer.x - ghc_6_12-13/Language/Python/Common/AST.hs - ghc_normal/Language/Python/Common/AST.hs +extra-source-files: src/Language/Python/Version3/Parser/Parser.y + src/Language/Python/Version3/Parser/Lexer.x + ghc_6_12-13/Language/Python/Common/AST.hs + ghc_normal/Language/Python/Common/AST.hs Library -- work around the memory usage bug in ghc 6.12.x if impl(ghc < 6.12) || impl(ghc >= 6.14) hs-source-dirs: src ghc_normal - else + else hs-source-dirs: src ghc_6_12-13 - build-depends: base == 4.*, containers < 0.4, pretty == 1.0.*, array < 0.4, transformers == 0.2.*, + build-depends: base == 4.*, containers < 0.5, pretty == 1.0.*, array < 0.5, transformers == 0.2.*, monads-tf == 0.1.* build-tools: happy, alex exposed-modules: diff --git a/src/Language/Python/Common/LexerUtils.hs b/src/Language/Python/Common/LexerUtils.hs index 3e8fb98..b755495 100644 --- a/src/Language/Python/Common/LexerUtils.hs +++ b/src/Language/Python/Common/LexerUtils.hs @@ -16,7 +16,7 @@ module Language.Python.Common.LexerUtils where import Control.Monad (liftM) import Control.Monad.Error.Class (throwError) import Data.List (foldl') -import Data.Map as Map hiding (null, map) +import Data.Map as Map hiding (null, map, foldl') import Numeric (readHex, readOct) import Language.Python.Common.Token as Token import Language.Python.Common.ParserMonad hiding (location) diff --git a/src/Language/Python/Common/Pretty.hs b/src/Language/Python/Common/Pretty.hs index bb09f5b..d886128 100644 --- a/src/Language/Python/Common/Pretty.hs +++ b/src/Language/Python/Common/Pretty.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TypeSynonymInstances #-} +{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Language.Python.Common.Pretty @@ -34,7 +34,7 @@ prettyPrefix maxLen x fullText = prettyText x instance Pretty String where - pretty s = text s + pretty = text -- | Conditionally wrap parentheses around an item. parensIf :: Pretty a => (a -> Bool) -> a -> Doc From 200cdb6accfe1761387ea18c0527d0fe3481fc69 Mon Sep 17 00:00:00 2001 From: Bill Casarin Date: Sat, 21 Apr 2012 14:58:28 -0400 Subject: [PATCH 2/2] Update pretty version --- language-python.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language-python.cabal b/language-python.cabal index 65c7fb4..4c7e2d1 100644 --- a/language-python.cabal +++ b/language-python.cabal @@ -27,7 +27,7 @@ Library else hs-source-dirs: src ghc_6_12-13 - build-depends: base == 4.*, containers < 0.5, pretty == 1.0.*, array < 0.5, transformers == 0.2.*, + build-depends: base == 4.*, containers < 0.5, pretty == 1.1.*, array < 0.5, transformers == 0.2.*, monads-tf == 0.1.* build-tools: happy, alex exposed-modules: