hpp 0.6.1 → 0.6.2
raw patch · 5 files changed
+17/−21 lines, 5 filesdep ~basedep ~semigroups
Dependency ranges changed: base, semigroups
Files
- hpp.cabal +4/−4
- src/Hpp/CmdLine.hs +2/−0
- src/Hpp/Expansion.hs +3/−1
- src/Hpp/Tokens.hs +3/−1
- tests/mcpp-validation.sh +5/−15
hpp.cabal view
@@ -1,5 +1,5 @@ name: hpp-version: 0.6.1+version: 0.6.2 synopsis: A Haskell pre-processor description: See the README for usage examples license: BSD3@@ -12,7 +12,7 @@ extra-source-files: tests/mcpp-validation.sh, CHANGELOG.md, README.md cabal-version: >=1.10 homepage: https://github.com/acowley/hpp-tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3+tested-with: GHC == 8.4.4 || == 8.6.5 || == 8.8.2 source-repository head type: git@@ -35,12 +35,12 @@ Hpp.StringSig, Hpp.Tokens, Hpp.Types- build-depends: base >=4.8 && <4.13, directory, time >=1.5, filepath,+ build-depends: base >=4.8 && < 4.14, directory, time >=1.5, filepath, transformers >=0.4, bytestring, unordered-containers, ghc-prim if impl(ghc < 8)- build-depends: semigroups >= 0.18 && < 0.19+ build-depends: semigroups >= 0.18 && < 0.20 hs-source-dirs: src default-language: Haskell2010
src/Hpp/CmdLine.hs view
@@ -85,6 +85,8 @@ go env acc cfg out rst -- We ignore source language specification go env acc cfg out ("-traditional":rst) = go env acc cfg out rst -- Ignore the "-traditional" flag+ go env acc cfg out ("-Werror":rst) =+ go env acc cfg out rst -- Ignore the "-Werror" flag go env acc cfg Nothing (file:rst) = case curFileNameF cfg of Nothing -> go env acc (cfg { curFileNameF = Just file }) Nothing rst
src/Hpp/Expansion.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE LambdaCase, OverloadedStrings, RankNTypes, ScopedTypeVariables #-}+{-# LANGUAGE CPP, LambdaCase, OverloadedStrings, RankNTypes, ScopedTypeVariables #-} -- | Line expansion is the core input token processing -- logic. Object-like macros are substituted, and function-like macro -- applications are expanded.@@ -8,7 +8,9 @@ import Data.Foldable (foldl', traverse_) import Data.List (delete) import Data.Maybe (listToMaybe, mapMaybe)+#if __GLASGOW_HASKELL__ < 808 import Data.Monoid ((<>))+#endif import Data.String (fromString) import Hpp.Config (Config, curFileName, getDateString, getTimeString, prepDate, prepTime)
src/Hpp/Tokens.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE BangPatterns, OverloadedStrings, ViewPatterns #-}+{-# LANGUAGE BangPatterns, CPP, OverloadedStrings, ViewPatterns #-} -- | Tokenization breaks a 'String' into pieces of whitespace, -- constants, symbols, and identifiers. module Hpp.Tokens (Token(..), detok, isImportant, notImportant, importants,@@ -7,7 +7,9 @@ import Control.Arrow (first, second) import Data.Char (isAlphaNum, isDigit, isSpace, isOctDigit, isHexDigit, digitToInt) import Data.Foldable (foldl')+#if __GLASGOW_HASKELL__ < 808 import Data.Monoid ((<>))+#endif import Data.String (IsString, fromString) import Hpp.StringSig
tests/mcpp-validation.sh view
@@ -3,6 +3,7 @@ HOST='http://prdownloads.sourceforge.net/mcpp/mcpp-2.7.2.tar.gz?download' FILE='mcpp-2.7.2.tar.gz' GCC=gcc+CABAL=${CABALBUILD:-cabal v2-build} # Note: head -n -1 would be faster than "sed '$ d'", but doesn't work # with BSD or OS X head.@@ -32,11 +33,7 @@ fi echo 'Building hpp'-if [ -z "$TRAVIS" ]; then- (cd .. && stack build hpp:hpp)-else- (cd .. && cabal new-build)-fi+(cd .. && ${CABAL}) if ! [ $? -eq 0 ]; then echo 'Building hpp failed' exit 1@@ -52,18 +49,11 @@ # Note that we define __i386__ as the architecture as the MCPP # validation test n_12.c assumes a long is 32 bits. - if [ -z "$TRAVIS" ]; then- case $(uname -s) in- Darwin)- (cd mcpp-2.7.2/test-c && ../tool/cpp_test HPP "$(cd ../../.. && stack exec which -- hpp) -I/usr/include ${GCCDIR} --cpp -D__i386__ -D__DARWIN_ONLY_UNIX_CONFORMANCE %s.c | gcc -o %s -w -x c -" "rm %s" < n_i_.lst)- ;;- *) (cd mcpp-2.7.2/test-c && ../tool/cpp_test HPP "$(find $(pwd)/../../../.stack-work -type f -executable -name hpp -print -quit) ${GCCDIR} --cpp -D__x86_64__ %s.c | gcc -o %s -w -x c -" "rm %s" < n_i_.lst)- esac+ (cd mcpp-2.7.2/test-c && ../tool/cpp_test HPP "$(find $(pwd)/../../../dist-newstyle -type f -executable -name hpp) ${GCCDIR} --cpp -D__x86_64__ %s.c | gcc -o %s -w -x c -" "rm %s" < n_i_.lst) else- (cd mcpp-2.7.2/test-c && ../tool/cpp_test HPP "$(find $(pwd)/../../../../dist-newstyle -type f -executable -name hpp) ${GCCDIR} --cpp -D__x86_64__ %s.c | gcc -o %s -w -x c -" "rm %s" < n_i_.lst)-fi-+ (cd mcpp-2.7.2/test-c && ../tool/cpp_test HPP "$(find $(pwd)/../../../../dist-newstyle -type f -executable -name hpp) ${GCCDIR} --cpp -D__x86_64__ %s.c | gcc -o %s -w -x c -" "rm %s" < n_i_.lst)+fi if ! [ $? -eq 0 ]; then echo 'The test runner exited with an error.' exit 1