packages feed

hoppy-generator 0.7.0 → 0.7.1

raw patch · 32 files changed

+50/−36 lines, 32 filessetup-changedPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Foreign.Hoppy.Generator.Spec: onParameterType :: (Type -> Type) -> Parameter -> Parameter
+ Foreign.Hoppy.Generator.Spec: stripToGc :: Type -> Type

Files

Setup.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
hoppy-generator.cabal view
@@ -1,12 +1,12 @@ name: hoppy-generator-version: 0.7.0+version: 0.7.1 synopsis: C++ FFI generator - Code generator homepage: http://khumba.net/projects/hoppy license: AGPL-3 license-file: LICENSE author: Bryan Gardiner <bog@khumba.net> maintainer: Bryan Gardiner <bog@khumba.net>-copyright: Copyright 2015-2019 Bryan Gardiner+copyright: Copyright 2015-2020 Bryan Gardiner category: Foreign build-type: Simple cabal-version: >=1.10
src/Foreign/Hoppy/Generator/Common.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by@@ -47,6 +47,9 @@ #endif import Control.Exception (evaluate) import Control.Monad (when)+#if !MIN_VERSION_base(4,13,0)+import Control.Monad.Fail (MonadFail)+#endif import Data.Char (toLower, toUpper) import qualified Data.List as L import qualified Data.Map as M@@ -69,7 +72,7 @@ fromEitherM = flip either return  -- | @maybeFail s x = maybe (fail s) x@-maybeFail :: Monad m => String -> Maybe a -> m a+maybeFail :: MonadFail m => String -> Maybe a -> m a maybeFail = fromMaybeM . fail  -- | @whileJust_ gen act@ runs @act@ on values generated from @gen@ until @gen@
src/Foreign/Hoppy/Generator/Common/Consume.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Compiler.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Hook.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by@@ -15,6 +15,8 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program.  If not, see <http://www.gnu.org/licenses/>. +{-# LANGUAGE CPP #-}+ -- | Hooks for controlling various parts of generators. module Foreign.Hoppy.Generator.Hook (   Hooks (..),@@ -40,7 +42,9 @@ import Control.Monad.Writer (execWriter, tell) import Data.ByteString.Lazy (ByteString, hPut) import Data.ByteString.Builder (stringUtf8, toLazyByteString)+#if !MIN_VERSION_base(4,12,0) import Data.List (splitAt)+#endif import qualified Data.Map as M import Data.Maybe (isJust, listToMaybe, mapMaybe) import qualified Data.Set as S
src/Foreign/Hoppy/Generator/Hook.hs-boot view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Language/Cpp.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Language/Cpp.hs-boot view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Language/Cpp/Internal.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Language/Haskell.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Language/Haskell.hs-boot view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Language/Haskell/Internal.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by@@ -47,7 +47,6 @@ import qualified Data.Set as S import Foreign.Hoppy.Generator.Common import Foreign.Hoppy.Generator.Spec-import Foreign.Hoppy.Generator.Spec.Class (toHsDataTypeName) import Foreign.Hoppy.Generator.Language.Haskell import System.FilePath ((<.>), pathSeparator) 
src/Foreign/Hoppy/Generator/Main.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Override.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Base.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by@@ -111,12 +111,13 @@   Type (..),   normalizeType,   stripConst,+  stripToGc,   Scoped (..),   isScoped,   -- * Functions and parameters   Constness (..), constNegate,   Purity (..),-  Parameter, parameterType, parameterName,+  Parameter, parameterType, onParameterType, parameterName,   IsParameter (..), toParameters,   np, (~:),   -- * Conversions@@ -1192,6 +1193,12 @@   Internal_TConst t' -> stripConst t'   _ -> t +-- | Strips a leading 'Internal_TToGc' off of a type.+stripToGc :: Type -> Type+stripToGc t = case t of+  Internal_TToGc t' -> t'+  _ -> t+ -- | Indicates whether an entity is scoped or unscoped. -- -- This is used to distinguish unscoped enums (@enum@) or scoped ones (@enum@@ -1253,6 +1260,7 @@     , parameterName = Nothing     } +-- | Maps a function over a parameter's type. onParameterType :: (Type -> Type) -> (Parameter -> Parameter) onParameterType f p = p { parameterType = f $ parameterType p } 
src/Foreign/Hoppy/Generator/Spec/Base.hs-boot view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Callback.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Callback.hs-boot view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Class.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Class.hs-boot view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/ClassFeature.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Conversion.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Enum.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Enum.hs-boot view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Function.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Function.hs-boot view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Spec/Variable.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Types.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Util.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by
src/Foreign/Hoppy/Generator/Version.hs view
@@ -1,6 +1,6 @@ -- This file is part of Hoppy. ----- Copyright 2015-2019 Bryan Gardiner <bog@khumba.net>+-- Copyright 2015-2020 Bryan Gardiner <bog@khumba.net> -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by