cpphs 1.20.9.1 → 1.20.10
raw patch · 14 files changed
+359/−340 lines, 14 filesdep −old-localedep ~basedep ~timenew-uploaderPVP ok
version bump matches the API change (PVP)
Dependencies removed: old-locale
Dependency ranges changed: base, time
API changes (from Hackage documentation)
Files
- CHANGELOG +0/−222
- CHANGELOG.md +232/−0
- Language/Preprocessor/Cpphs/CppIfdef.hs +2/−2
- Language/Preprocessor/Cpphs/HashDefine.hs +1/−1
- Language/Preprocessor/Cpphs/MacroPass.hs +1/−1
- Language/Preprocessor/Cpphs/Options.hs +1/−1
- Language/Preprocessor/Cpphs/ReadFirst.hs +1/−1
- Language/Preprocessor/Cpphs/RunCpphs.hs +2/−2
- Language/Preprocessor/Cpphs/SymTab.hs +4/−4
- README +0/−52
- README.md +60/−0
- cpphs.cabal +51/−45
- cpphs.hs +4/−5
- old/TimeCompat.hs +0/−4
− CHANGELOG
@@ -1,222 +0,0 @@-Version 1.20-------------- * bugfixes for #if defined(FOO) && FOO(a,b)- * (1.20.1): fix version number- * (1.20.2): ensure all input/output is UTF8, regardless of locale- * (1.20.3): detect an absolute windows path with a drive letter in a #include- * (1.20.4): more windows path handling- * (1.20.5): revert change in 1.20.4- * (1.20.6): minor bugfix for crash in obscure corner case- * (1.20.7): bugfix for windows drive letter in #include- * (1.20.8): another bugfix for windows drive letter in #include--Version 1.19-------------- * expose more of the cpphs API- * allow the static linking exception to the LGPL- * (1.19.1): don't warn about trailing comments in #ifdefs- * (1.19.2): fix build error- * (1.19.3): bugfix for hlint ticket #161 - interaction of --unlit/--linepragma--Version 1.18-------------- * better lexing of Template Haskell single quotes (thanks to Stefan Wehr)- * (1.18.1): fix incomplete pattern match- * (1.18.2): bugfix for erroneous boolean intepretation of some macro- expansions in #if clauses- * (1.18.3): further rewrites of the #if expression parser- * (1.18.4): fix the accidental flipping of comment-stripping behaviour- with --cpp -traditional flags- * (1.18.5): fix a bug with windows filepath directory separators in a- #include- * (1.18.6): bugfix to reject a macro usage with different arity than- its definition- * (1.18.7): bugfix to accept a #include with absolute filepath- * (1.18.8): fix version number- * (1.18.9): accept #if defined foo as well as #if defined(foo)--Version 1.17-------------- * recursively evaluate #if expressions after macro expansion (fix)- * (1.17.1): report the right version with cpphs --version--Version 1.16-------------- * fix interaction of runCpphsReturningSymTab with --nomacro--Version 1.15-------------- * Fix the interaction of --nomacro with --strip.- * Fix the error message received when # appears without a command.--Version 1.14-------------- * New API to return symbol table after processing.--Version 1.13-------------- * Accept -U cmdline option for compatibility with cpp.--Version 1.12-------------- * Allow it to build with ghc-7.2.--Version 1.11-------------- * API change: runCpphs, cppIfdef, and macroPass are now in the IO monad.--Version 1.10------------- * New command-line option: "--linepragma"- It converts #line droppings into {-# LINE #-}.--Version 1.9------------- * Bugfix for #undef.--Version 1.8------------- * Bugfix for off-by-one error in line numbers with --include=file.--Version 1.7------------- * Bugfix in interaction of --unlit with \end{code}--Version 1.6------------- * New command-line option: "--include=filename".- * New command-line option: "--strip-eol" for comment-stripping.- * Line pragmas can have filenames containing spaces.--Version 1.5------------- * Parametrised macro-calls now permitted in #ifdef's.- * Recursive textual expansion now permitted in #ifdef's.- * Better options-handling when used as a library.- * Various small bugfixes--Version 1.4------------- * Added a "--pragma" option to retain #pragma in the output.- * Fixed a number of obscure corner cases involving the interaction of- multiple features e.g. foo##__LINE__.- * Added the "--nowarn" option.--Version 1.3------------- * Added a "--cpp" option for drop-in compatibility with standard cpp.- It causes cpphs to accept standard cpp flags and translate- them to cpphs equivalents. Compatibility options include: -o, -ansi,- -traditional, -stdc, -x, -include, -P, -C, -CC, -A. The file- behaviour is different too - if two filenames are given on the- commandline, then the second is treated as the output location.- * Fixed a corner-case bug in evaluating chained and overlapping #ifdefs.--Version 1.2------------- * Re-arranged the source files into hierarchical libraries.- * Exposed the library interface as an installable Cabal package, with- Haddock documentation.- * Added the --unlit option, for removing literate-style comments.--Version 1.1------------- * Fix the .cabal way of building cpphs.- * Update the --version reported (forgotten in 1.0, which still reports 0.9)- * No longer throws an error when given an empty file as input.--Version 1.0------------- * Add a compatibility script cpphs.compat, allowing cpphs to act as- a drop-in replacement for cpp, e.g.- ghc -cpp -pgmP cpphs.compat- * Place quotes around replacements for special macros __FILE__, __DATE__,- and __TIME__.- * If no files are specified, read from stdin.- * Ignore #! lines (e.g. in scripts)- * Parse -D commandline options once only, and consistently with cpp,- i.e. -Dfoo means foo=1- * Fix compatibility with preprocessors like hsc2hs, which use- non-cpp directives like #def. They are now passed through to the- output with a warning to stderr.--Version 0.9------------- * Bugfix for ghc-6.4 -O: flush the output buffer.--Version 0.8------------- * Added the --text option, to signify the input should not- be lexed as Haskell. This causes macros to be defined or expanded- regardless of their location within comments, string delimiters, etc.- * Shuffle a few files around to make it easier to say 'hmake cpphs'.- There is also now a runhugs script to invoke cpphs nicely.--Version 0.7------------- * Enable the __FILE__, __LINE__, __DATE__, and __TIME__ specials, which- can be useful for creating DIY error messages.--Version 0.6------------- * Recognise and ignore the #pragma cpp directive.- * Fix beginning-of-file bug, where in --noline mode, a # cpp directive- at the top of the file appeared in the output.- * Fix chained parenthesised boolean exprs in #if, e.g.- #if ( foo ) && ( bar )- * Fix precedence in chained unparenthesised boolean exprs in #if, e.g.- #if foo && bar || baz && frob- * For better compatibility with cpp, and because otherwise- there are certain constructs that cannot be expressed, we no- longer permit whitespace in a <tt>#define</tt> between the- symbolname and an opening parenthesis, e.g.- #define f (f' id)- Previously, this was interpreted as a parametrised macro,- with arguments in the parens, and no expansion. Now, the space- indicates that this is a textual replacement, and the parenthesised- expression is in fact the replacement.--Version 0.5------------- * Added a --version flag to report the version number.- * Renamed --stringise to --hashes, and use it to turn on ## catenation- as well.- * Bugfix for #if 1, previously taken as false.- * Bugfix for --nolines: it no longer adds extra spurious newlines.- * File inclusion now looks in the directory of the calling file.- * Failure to find an include file is now merely a warning to stderr- rather than an error.- * Added a --layout flag. Previously, line continuations in a macro- definition were always preserved in the output, permitting use- of the Haskell layout rule even inside a macro. The default is now- to remove line continuations for conformance with cpp, but the option- of using --layout is still possible.--Version 0.4------------- * New flag -Ofile to redirect output- * Bugfix for precedence in #if !False && False- * Bugfix for whitespace between # and if- * Bugfix for #define F "blah"; #include F--Version 0.3------------- * Bugfix for recursive macro expansion.- * New flag --strip to remove C comments even outside cpp directives.- * New flag --stringise to recognise the # stringise operator in macros.--Version 0.2------------- * New flag --noline to eliminate #line directives from output.- * Add symbol-replacement and macro-expansion.- * New flag --nomacro to turn off symbol/macro-expansion.--2004-Apr-21------------- * Now accept multi-line # commands via the \ line continuation operator.- The original file line numbering is preserved in the output by- some tricky acrobatics.--Version 0.1------------- * Initial release.
+ CHANGELOG.md view
@@ -0,0 +1,232 @@+Version 1.20.10+---------------++_Andreas Abel, 2025-09-14_++ * Drop support for GHC 7.+ * Remove cabal flag `old-locale`.+ * Compatibility with `{-# LANGUAGE RecordDotSyntax #-}` (Lennart Augustsson).+ * Build tested with GHC 8.0 - 9.14 alpha1.++Version 1.20+------------+ * bugfixes for `#if defined(FOO) && FOO(a,b)`+ * (1.20.1): fix version number+ * (1.20.2): ensure all input/output is UTF8, regardless of locale+ * (1.20.3): detect an absolute windows path with a drive letter in a #include+ * (1.20.4): more windows path handling+ * (1.20.5): revert change in 1.20.4+ * (1.20.6): minor bugfix for crash in obscure corner case+ * (1.20.7): bugfix for windows drive letter in #include+ * (1.20.8): another bugfix for windows drive letter in #include++Version 1.19+------------+ * expose more of the cpphs API+ * allow the static linking exception to the LGPL+ * (1.19.1): don't warn about trailing comments in #ifdefs+ * (1.19.2): fix build error+ * (1.19.3): bugfix for hlint ticket #161 - interaction of --unlit/--linepragma++Version 1.18+------------+ * better lexing of Template Haskell single quotes (thanks to Stefan Wehr)+ * (1.18.1): fix incomplete pattern match+ * (1.18.2): bugfix for erroneous boolean intepretation of some macro+ expansions in #if clauses+ * (1.18.3): further rewrites of the #if expression parser+ * (1.18.4): fix the accidental flipping of comment-stripping behaviour+ with --cpp -traditional flags+ * (1.18.5): fix a bug with windows filepath directory separators in a+ #include+ * (1.18.6): bugfix to reject a macro usage with different arity than+ its definition+ * (1.18.7): bugfix to accept a #include with absolute filepath+ * (1.18.8): fix version number+ * (1.18.9): accept #if defined foo as well as #if defined(foo)++Version 1.17+------------+ * recursively evaluate #if expressions after macro expansion (fix)+ * (1.17.1): report the right version with cpphs --version++Version 1.16+------------+ * fix interaction of runCpphsReturningSymTab with --nomacro++Version 1.15+------------+ * Fix the interaction of --nomacro with --strip.+ * Fix the error message received when # appears without a command.++Version 1.14+------------+ * New API to return symbol table after processing.++Version 1.13+------------+ * Accept -U cmdline option for compatibility with cpp.++Version 1.12+------------+ * Allow it to build with ghc-7.2.++Version 1.11+------------+ * API change: runCpphs, cppIfdef, and macroPass are now in the IO monad.++Version 1.10+-----------+ * New command-line option: "--linepragma"+ It converts #line droppings into {-# LINE #-}.++Version 1.9+-----------+ * Bugfix for #undef.++Version 1.8+-----------+ * Bugfix for off-by-one error in line numbers with --include=file.++Version 1.7+-----------+ * Bugfix in interaction of --unlit with \end{code}++Version 1.6+-----------+ * New command-line option: "--include=filename".+ * New command-line option: "--strip-eol" for comment-stripping.+ * Line pragmas can have filenames containing spaces.++Version 1.5+-----------+ * Parametrised macro-calls now permitted in #ifdef's.+ * Recursive textual expansion now permitted in #ifdef's.+ * Better options-handling when used as a library.+ * Various small bugfixes++Version 1.4+-----------+ * Added a "--pragma" option to retain #pragma in the output.+ * Fixed a number of obscure corner cases involving the interaction of+ multiple features e.g. foo##__LINE__.+ * Added the "--nowarn" option.++Version 1.3+-----------+ * Added a "--cpp" option for drop-in compatibility with standard cpp.+ It causes cpphs to accept standard cpp flags and translate+ them to cpphs equivalents. Compatibility options include: -o, -ansi,+ -traditional, -stdc, -x, -include, -P, -C, -CC, -A. The file+ behaviour is different too - if two filenames are given on the+ commandline, then the second is treated as the output location.+ * Fixed a corner-case bug in evaluating chained and overlapping #ifdefs.++Version 1.2+-----------+ * Re-arranged the source files into hierarchical libraries.+ * Exposed the library interface as an installable Cabal package, with+ Haddock documentation.+ * Added the --unlit option, for removing literate-style comments.++Version 1.1+-----------+ * Fix the .cabal way of building cpphs.+ * Update the --version reported (forgotten in 1.0, which still reports 0.9)+ * No longer throws an error when given an empty file as input.++Version 1.0+-----------+ * Add a compatibility script cpphs.compat, allowing cpphs to act as+ a drop-in replacement for cpp, e.g.+ ghc -cpp -pgmP cpphs.compat+ * Place quotes around replacements for special macros __FILE__, __DATE__,+ and __TIME__.+ * If no files are specified, read from stdin.+ * Ignore #! lines (e.g. in scripts)+ * Parse -D commandline options once only, and consistently with cpp,+ i.e. -Dfoo means foo=1+ * Fix compatibility with preprocessors like hsc2hs, which use+ non-cpp directives like #def. They are now passed through to the+ output with a warning to stderr.++Version 0.9+-----------+ * Bugfix for ghc-6.4 -O: flush the output buffer.++Version 0.8+-----------+ * Added the --text option, to signify the input should not+ be lexed as Haskell. This causes macros to be defined or expanded+ regardless of their location within comments, string delimiters, etc.+ * Shuffle a few files around to make it easier to say 'hmake cpphs'.+ There is also now a runhugs script to invoke cpphs nicely.++Version 0.7+-----------+ * Enable the __FILE__, __LINE__, __DATE__, and __TIME__ specials, which+ can be useful for creating DIY error messages.++Version 0.6+-----------+ * Recognise and ignore the #pragma cpp directive.+ * Fix beginning-of-file bug, where in --noline mode, a # cpp directive+ at the top of the file appeared in the output.+ * Fix chained parenthesised boolean exprs in #if, e.g.+ #if ( foo ) && ( bar )+ * Fix precedence in chained unparenthesised boolean exprs in #if, e.g.+ #if foo && bar || baz && frob+ * For better compatibility with cpp, and because otherwise+ there are certain constructs that cannot be expressed, we no+ longer permit whitespace in a <tt>#define</tt> between the+ symbolname and an opening parenthesis, e.g.+ #define f (f' id)+ Previously, this was interpreted as a parametrised macro,+ with arguments in the parens, and no expansion. Now, the space+ indicates that this is a textual replacement, and the parenthesised+ expression is in fact the replacement.++Version 0.5+-----------+ * Added a --version flag to report the version number.+ * Renamed --stringise to --hashes, and use it to turn on ## catenation+ as well.+ * Bugfix for #if 1, previously taken as false.+ * Bugfix for --nolines: it no longer adds extra spurious newlines.+ * File inclusion now looks in the directory of the calling file.+ * Failure to find an include file is now merely a warning to stderr+ rather than an error.+ * Added a --layout flag. Previously, line continuations in a macro+ definition were always preserved in the output, permitting use+ of the Haskell layout rule even inside a macro. The default is now+ to remove line continuations for conformance with cpp, but the option+ of using --layout is still possible.++Version 0.4+-----------+ * New flag -Ofile to redirect output+ * Bugfix for precedence in #if !False && False+ * Bugfix for whitespace between # and if+ * Bugfix for #define F "blah"; #include F++Version 0.3+-----------+ * Bugfix for recursive macro expansion.+ * New flag --strip to remove C comments even outside cpp directives.+ * New flag --stringise to recognise the # stringise operator in macros.++Version 0.2+-----------+ * New flag --noline to eliminate #line directives from output.+ * Add symbol-replacement and macro-expansion.+ * New flag --nomacro to turn off symbol/macro-expansion.++2004-Apr-21+-----------+ * Now accept multi-line # commands via the \ line continuation operator.+ The original file line numbering is preserved in the output by+ some tricky acrobatics.++Version 0.1+-----------+ * Initial release.
Language/Preprocessor/Cpphs/CppIfdef.hs view
@@ -3,7 +3,7 @@ -- Module : CppIfdef -- Copyright : 1999-2004 Malcolm Wallace -- Licence : LGPL--- +-- -- Maintainer : Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk> -- Stability : experimental -- Portability : All@@ -236,7 +236,7 @@ fragment = many1 (satisfy (`notElem`",)")) convert "defined" [arg] = case lookupST arg st of- Nothing | all isDigit arg -> return arg + Nothing | all isDigit arg -> return arg Nothing -> return "0" Just (a@AntiDefined{}) -> return "0" Just (a@SymbolReplacement{}) -> return "1"
Language/Preprocessor/Cpphs/HashDefine.hs view
@@ -10,7 +10,7 @@ -- -- What structures are declared in a \#define. ------------------------------------------------------------------------------ + module Language.Preprocessor.Cpphs.HashDefine ( HashDefine(..) , ArgOrText(..)
Language/Preprocessor/Cpphs/MacroPass.hs view
@@ -167,7 +167,7 @@ Just (args,ws') -> if length args /= length (arguments hd) then emit x $ macroProcess pr layout lang st ws- else do args' <- mapM (fmap (concat.onlyRights)+ else do args' <- mapM (fmap (concat . onlyRights) . macroProcess pr layout lang st) args
Language/Preprocessor/Cpphs/Options.hs view
@@ -24,7 +24,7 @@ import Data.List (isPrefixOf) -- | Cpphs options structure.-data CpphsOptions = CpphsOptions +data CpphsOptions = CpphsOptions { infiles :: [FilePath] , outfiles :: [FilePath] , defines :: [(String,String)]
Language/Preprocessor/Cpphs/ReadFirst.hs view
@@ -3,7 +3,7 @@ -- Module : ReadFirst -- Copyright : 2004 Malcolm Wallace -- Licence : LGPL--- +-- -- Maintainer : Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk> -- Stability : experimental -- Portability : All
Language/Preprocessor/Cpphs/RunCpphs.hs view
@@ -30,7 +30,7 @@ let bools = boolopts options preInc = case preInclude options of [] -> ""- is -> concatMap (\f->"#include \""++f++"\"\n") is + is -> concatMap (\f->"#include \""++f++"\"\n") is ++ "#line 1 \""++cleanPath filename++"\"\n" pass1 <- cppIfdef filename (defines options) (includes options) bools@@ -57,7 +57,7 @@ let bools = boolopts options preInc = case preInclude options of [] -> ""- is -> concatMap (\f->"#include \""++f++"\"\n") is + is -> concatMap (\f->"#include \""++f++"\"\n") is ++ "#line 1 \""++cleanPath filename++"\"\n" (pass2,syms) <- if macros bools then do
Language/Preprocessor/Cpphs/SymTab.hs view
@@ -3,7 +3,7 @@ -- Module : SymTab -- Copyright : 2000-2004 Malcolm Wallace -- Licence : LGPL--- +-- -- Maintainer : Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk> -- Stability : Stable -- Portability : All@@ -36,11 +36,11 @@ emptyST = itgen maxHash [] insertST (s,v) ss = itiap (hash s) ((s,v):) ss id-deleteST s ss = itiap (hash s) (filter ((/=s).fst)) ss id-lookupST s ss = let vs = filter ((==s).fst) ((itind (hash s)) ss)+deleteST s ss = itiap (hash s) (filter ((/=s) . fst)) ss id+lookupST s ss = let vs = filter ((==s) . fst) ((itind (hash s)) ss) in if null vs then Nothing else (Just . snd . head) vs-definedST s ss = let vs = filter ((==s).fst) ((itind (hash s)) ss)+definedST s ss = let vs = filter ((==s) . fst) ((itind (hash s)) ss) in (not . null) vs flattenST ss = itfold (map snd) (++) ss
− README
@@ -1,52 +0,0 @@-This directory contains 'cpphs', a simplified but robust-re-implementation of cpp, the C pre-processor, in Haskell.--TO BUILD----------Just use- hmake cpphs [-package base]-or- ghc --make cpphs [-o cpphs] # -o needed for ghc <= 6.4.1 ]-or- runhugs cpphs # or rename the script cpphs.hugs to cpphs---USAGE------- cpphs [filename | -Dsym | -Dsym=val | -Ipath]+ [-Ofile]- [ --include=file ]*- [ --nomacro | --noline | --nowarn | --strip | --strip-eol |- --pragma | --text | --hashes | --layout | --unlit |- --linepragma ]*- [ --cpp compatopts ]--For fuller details, see docs/index.html--If you want to use cpphs as a completely drop-in replacement for the-real cpp, that is, to accept the same arguments, and have broadly-the same behaviour in response to them, then use the --cpp compatibility-option.---COPYRIGHT-----------Copyright (c) 2004-2017 Malcolm Wallace (Malcolm.Wallace@me.com)---LICENCE---------These library modules are distributed under the terms of the LGPL.-The application module 'cpphs.hs' is GPL.--This software comes with no warranty. Use at your own risk.--If you have a commercial use for cpphs, and feel the terms of the (L)GPL-are too onerous, you have the option of distributing unmodified binaries-(only, not sources) under the terms of a different licence (see-LICENCE-commercial).---WEBSITE---------http://projects.haskell.org/cpphs/-darcs get http://code.haskell.org/~malcolm/cpphs
+ README.md view
@@ -0,0 +1,60 @@+[](http://hackage.haskell.org/package/cpphs)+[](https://www.stackage.org/package/cpphs)+[](https://stackage.org/nightly/package/cpphs)+[](https://github.com/haskell-pkg-janitors/cpphs/actions)++cpphs+=====++A liberalised re-implementation of `cpp`, the C pre-processor.++`cpphs` is a re-implementation of the C pre-processor that is both more compatible with Haskell,+and itself written in Haskell so that it can be distributed with compilers.++This version of the C pre-processor is pretty-much feature-complete and compatible with traditional (K&R) pre-processors.+Additional features include: a plain-text mode; an option to unlit literate code files; and an option to turn off macro-expansion.++Usage+-----++ cpphs [filename | -Dsym | -Dsym=val | -Ipath]+ [-Ofile]+ [ --include=file ]*+ [ --nomacro | --noline | --nowarn | --strip | --strip-eol |+ --pragma | --text | --hashes | --layout | --unlit |+ --linepragma ]*+ [ --cpp compatopts ]++For fuller details, see [docs/index.html](docs/index.html).++If you want to use `cpphs` as a completely drop-in replacement for the+real cpp, that is, to accept the same arguments, and have broadly+the same behaviour in response to them, then use the `--cpp` compatibility+option.+++Copyright+---------++(c) 2004-2017 Malcolm Wallace (Malcolm.Wallace@me.com)+++Licence+-------++These library modules are distributed under the terms of the LGPL.+The application module `cpphs.hs` is GPL.++This software comes with no warranty. Use at your own risk.++If you have a commercial use for cpphs, and feel the terms of the (L)GPL+are too onerous, you have the option of distributing unmodified binaries+(only, not sources) under the terms of a different licence (see+LICENCE-commercial).+++Website+-------++Description see: https://hackage.haskell.org/package/cpphs++Old homepage: https://archives.haskell.org/projects.haskell.org/cpphs/
cpphs.cabal view
@@ -1,13 +1,13 @@+Cabal-Version: 1.18 Name: cpphs-Version: 1.20.9.1+Version: 1.20.10 Copyright: 2004-2017, Malcolm Wallace License: LGPL License-File: LICENCE-LGPL-Cabal-Version: >= 1.8 Author: Malcolm Wallace <Malcolm.Wallace@me.com>-Maintainer: Malcolm Wallace <Malcolm.Wallace@me.com>-Homepage: http://projects.haskell.org/cpphs/-bug-reports: https://github.com/malcolmwallace/cpphs/issues+Maintainer: Andreas Abel+-- homepage:+bug-reports: https://github.com/haskell-pkg-janitors/cpphs/issues Synopsis: A liberalised re-implementation of cpp, the C pre-processor. Description: Cpphs is a re-implementation of the C pre-processor that is both@@ -19,41 +19,49 @@ pre-processors. Additional features include: a plain-text mode; an option to unlit literate code files; and an option to turn off macro-expansion.+ .+ Old homepage: <https://archives.haskell.org/projects.haskell.org/cpphs/> Category: Development Build-type: Simple-Extra-Source-Files: README, LICENCE-GPL, LICENCE-commercial, CHANGELOG, docs/cpphs.1, docs/index.html +Extra-Doc-Files:+ README.md+ LICENCE-GPL+ LICENCE-commercial+ CHANGELOG.md+ docs/cpphs.1+ docs/index.html+ tested-with:- ghc ==8.10.1- || ==8.8.3- || ==8.6.5- || ==8.4.4- || ==8.2.2- || ==8.0.2- || ==7.10.3- || ==7.8.4- || ==7.6.3- || ==7.4.2- || ==7.2.2- || ==7.0.4+ GHC == 9.14.1+ GHC == 9.12.2+ GHC == 9.10.2+ GHC == 9.8.4+ GHC == 9.6.7+ GHC == 9.4.8+ GHC == 9.2.8+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2 -flag old-locale- description: If true, use old-locale, otherwise use time 1.5 or newer.- manual: False- default: False+Source-Repository head+ Type: git+ Location: https://github.com/haskell-pkg-janitors/cpphs.git Library- Build-Depends: base >= 4.3 && <5, directory <1.4, polyparse>=1.13 && <1.14-- if flag(old-locale)- Build-Depends:- old-locale >=1.0.0.2 && <1.1- , time >=0 && <1.5- Hs-Source-Dirs: . old+ Hs-Source-Dirs: . new - else- Build-Depends: time >=1.5 && <1.11- Hs-Source-Dirs: . new+ Build-Depends:+ -- GHC-shipped libraries+ base >= 4.9 && < 5+ , directory < 1.4+ , time >= 1.5 && < 2+ -- Other libraries+ , polyparse >= 1.13 && < 1.14 Exposed-Modules: Language.Preprocessor.Cpphs@@ -70,19 +78,19 @@ Language.Preprocessor.Cpphs.Tokenise TimeCompat + default-language: Haskell2010+ Executable cpphs- Build-Depends: base>=3&&<6, directory <1.4, polyparse>=1.13 && <1.14+ Hs-Source-Dirs: . new Main-Is: cpphs.hs - if flag(old-locale)- Build-Depends:- old-locale >=1.0.0.2 && <1.1- , time >=0 && <1.5- Hs-Source-Dirs: . old-- else- Build-Depends: time >=1.5 && <1.11- Hs-Source-Dirs: . new+ Build-Depends:+ -- GHC-shipped libraries+ base >= 4.9 && < 5+ , directory < 1.4+ , time >= 1.5 && < 2+ -- Other libraries+ , polyparse >= 1.13 && < 1.14 Other-Modules: Language.Preprocessor.Cpphs@@ -98,6 +106,4 @@ Language.Preprocessor.Cpphs.Tokenise TimeCompat -Source-Repository head- Type: git- Location: https://github.com/hackage-trustees/malcolm-wallace-universe+ default-language: Haskell2010
cpphs.hs view
@@ -31,7 +31,7 @@ args <- getArgs args <- return $ if "--cpp" `elem` args then convertArgs args else args- + prog <- getProgName when ("--version" `elem` args) (do putStrLn (prog++" "++version)@@ -49,7 +49,7 @@ ins = infiles options outs = outfiles options out = listToMaybe outs- + when (isLeft parsedArgs) (do putStrLn $ "Unknown option "++fromLeft parsedArgs ++", for valid options try "++prog++" --help\n"@@ -88,7 +88,7 @@ convertArgs xs = f (ConvertArgs False True "-" "-") xs where flg = "DUI"- + f e (['-',r]:x:xs) | r `elem` flg = ('-':r:x) : f e xs f e (x@('-':r:_):xs) | r `elem` flg = x : f e xs f e ("-o":x:xs) = ('-':'O':x) : f e xs@@ -106,11 +106,10 @@ f e ("-version":xs) = "--version" : f e xs f e (('-':x):xs) = f e xs -- strip all other flags f e (x:xs) = f (if infile e == "-" then e{infile=x} else e{outfile=x}) xs- + f e [] = ["--hashes" | not (traditional e)] ++ ["--strip" | traditional e && strip e] ++ ["--strip-eol" | not (traditional e) && strip e] ++ [infile e] ++ ["-O" ++ outfile e | outfile e /= "-"]-
− old/TimeCompat.hs
@@ -1,4 +0,0 @@-module TimeCompat (defaultTimeLocale, formatTime) where--import Data.Time.Format (formatTime)-import System.Locale (defaultTimeLocale)