cpphs 1.18.4 → 1.18.5
raw patch · 13 files changed
+43/−48 lines, 13 files
Files
- CHANGELOG +2/−0
- Language/Preprocessor/Cpphs/Position.hs +9/−1
- Language/Preprocessor/Cpphs/ReadFirst.hs +3/−2
- Language/Preprocessor/Cpphs/RunCpphs.hs +3/−2
- Makefile +2/−2
- cpphs.cabal +2/−2
- cpphs.hs +1/−1
- docs/index.html +11/−3
- tests/emptyhashes +0/−5
- tests/gabor +0/−9
- tests/minversion +0/−13
- tests/runtests +1/−1
- tests/tmp +9/−7
CHANGELOG view
@@ -7,6 +7,8 @@ * (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 Version 1.17
Language/Preprocessor/Cpphs/Position.hs view
@@ -17,6 +17,7 @@ , addcol, newline, tab, newlines, newpos , cppline, haskline, cpp2hask , filename, lineno, directory+ , cleanPath ) where import Data.List (isPrefixOf)@@ -38,7 +39,7 @@ -- | Constructor. Argument is filename. newfile :: String -> Posn-newfile name = Pn name 1 1 Nothing+newfile name = Pn (cleanPath name) 1 1 Nothing -- | Increment column number by given quantity. addcol :: Int -> Posn -> Posn@@ -96,4 +97,11 @@ dirname = reverse . safetail . dropWhile (not.(`elem`"\\/")) . reverse where safetail [] = [] safetail (_:x) = x++-- | Sigh. Mixing Windows filepaths with unix is bad. Make sure there is a+-- canonical path separator.+cleanPath :: FilePath -> FilePath+cleanPath [] = []+cleanPath ('\\':cs) = '/': cleanPath cs+cleanPath (c:cs) = c: cleanPath cs
Language/Preprocessor/Cpphs/ReadFirst.hs view
@@ -19,7 +19,7 @@ import System.Directory (doesFileExist) import Data.List (intersperse) import Control.Monad (when)-import Language.Preprocessor.Cpphs.Position (Posn,directory)+import Language.Preprocessor.Cpphs.Position (Posn,directory,cleanPath) -- | Attempt to read the given file from any location within the search path. -- The first location found is returned, together with the file content.@@ -46,8 +46,9 @@ ++"\n Asked for by: "++show demand) return ("missing file: "++name,"") try (p:ps) = do- let file = p++'/':name+ let file = cleanPath p++'/':cleanPath name ok <- doesFileExist file if not ok then try ps else do content <- readFile file return (file,content)+
Language/Preprocessor/Cpphs/RunCpphs.hs view
@@ -13,6 +13,7 @@ import Language.Preprocessor.Cpphs.Options (CpphsOptions(..), BoolOptions(..) ,trailing) import Language.Preprocessor.Cpphs.Tokenise (deWordStyle, tokenise)+import Language.Preprocessor.Cpphs.Position (cleanPath) import Language.Preprocessor.Unlit as Unlit (unlit) @@ -23,7 +24,7 @@ preInc = case preInclude options of [] -> "" is -> concatMap (\f->"#include \""++f++"\"\n") is - ++ "#line 1 \""++filename++"\"\n"+ ++ "#line 1 \""++cleanPath filename++"\"\n" pass1 <- cppIfdef filename (defines options) (includes options) bools (preInc++input)@@ -47,7 +48,7 @@ preInc = case preInclude options of [] -> "" is -> concatMap (\f->"#include \""++f++"\"\n") is - ++ "#line 1 \""++filename++"\"\n"+ ++ "#line 1 \""++cleanPath filename++"\"\n" (pass2,syms) <- if macros bools then do pass1 <- cppIfdef filename (defines options) (includes options)
Makefile view
@@ -1,5 +1,5 @@ LIBRARY = cpphs-VERSION = 1.18.4+VERSION = 1.18.5 DIRS = Language/Preprocessor/Cpphs \ Text/ParserCombinators@@ -32,7 +32,7 @@ tar cf tmp.tar $(SRCS) $(AUX) mkdir $(LIBRARY)-$(VERSION) cd $(LIBRARY)-$(VERSION); tar xf ../tmp.tar- tar zcf $(LIBRARY)-$(VERSION).tar.gz $(LIBRARY)-$(VERSION)+ tar --format=ustar -zcf $(LIBRARY)-$(VERSION).tar.gz $(LIBRARY)-$(VERSION) zip -r $(LIBRARY)-$(VERSION).zip $(LIBRARY)-$(VERSION) rm -r tmp.tar $(LIBRARY)-$(VERSION) haddock: $(SRCS)
cpphs.cabal view
@@ -1,5 +1,5 @@ Name: cpphs-Version: 1.18.4+Version: 1.18.5 Copyright: 2004-2014, Malcolm Wallace License: LGPL License-File: LICENCE-LGPL@@ -39,7 +39,7 @@ Language.Preprocessor.Cpphs.Tokenise Executable cpphs- Build-Depends: base>3&&<6, old-locale, old-time, directory+ Build-Depends: base>3&&<6, old-locale, old-time, directory, polyparse>=1.9 Main-Is: cpphs.hs Other-Modules: Language.Preprocessor.Cpphs
cpphs.hs view
@@ -20,7 +20,7 @@ import Data.List ( isPrefixOf ) version :: String-version = "1.18.4"+version = "1.18.5" main :: IO () main = do
docs/index.html view
@@ -198,12 +198,11 @@ <b>Current stable version:</b> <p>-cpphs-1.18.4, release date 2014.03.22<br>+cpphs-1.18.5, release date 2014.06.26<br> By HTTP: <a href="http://hackage.haskell.org/package/cpphs">Hackage</a>. <ul>-<li> fix the accidental flipping of comment-stripping behaviour- with --cpp -traditional flags.+<li> fix a bug related to windows filepath directory separators in #includes </ul> <p>@@ -225,6 +224,15 @@ <p> <b>Older versions:</b>++<p>+cpphs-1.18.4, release date 2014.03.22<br>+By HTTP:+<a href="http://hackage.haskell.org/package/cpphs">Hackage</a>.+<ul>+<li> fix the accidental flipping of comment-stripping behaviour+ with --cpp -traditional flags.+</ul> <p> cpphs-1.18.3, release date 2014.03.03<br>
− tests/emptyhashes
@@ -1,5 +0,0 @@-this is a test with a hash on a line of its own-#-with no command after it.-#define FOO-and ending here
− tests/gabor
@@ -1,9 +0,0 @@-#ifndef MIN_VERSION_base-#error "no MIN_VERSION_base"-#endif--#if MIN_VERSION_base(4, 4, 0)-#error "4.4.0"-#else-#error "no 4.4.0"-#endif
− tests/minversion
@@ -1,13 +0,0 @@-#define MIN_VERSION_base(x,y,z) (x>=4) && (y>=5) && (z>=1)--#if !(MIN_VERSION_base(4, 7, 0))-import Data.Typeable (Typeable2, typeOf2, mkTyConApp)-version not 4.7.0-#endif-#if MIN_VERSION_base(4, 4, 0)-import Data.Typeable (mkTyCon3)-version 4.4.0-#else-import Data.Typeable (mkTyCon)-version any-#endif
tests/runtests view
@@ -3,7 +3,7 @@ FAIL=0 runtest() {- if $1 >out 2>/dev/null && diff $2 out >/dev/null+ if $1 >out 2>/dev/null && dos2unix -q out && diff $2 out >/dev/null then echo "passed: " $1 else FAIL=$? echo "FAILED: ($2) " $1
tests/tmp view
@@ -1,7 +1,9 @@-#line 1 "nomacro"-This file is intended to show the interaction of --nomacro with --strip-which was broken up until cpphs-1.14.--Here is a line with some comment -Here is a line with some C89 comment with more text after it.-Here is a line that uses FOO but it should look like uppercase foo, not 1.+#line 1 "booleanchain" + +This file tests the #if boolean expression parser/evaluator. + + + + +SUCCEED with not and parens +