cpphs 1.8 → 1.9
raw patch · 10 files changed
+33/−10 lines, 10 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG +4/−0
- Language/Preprocessor/Cpphs/CppIfdef.hs +1/−1
- Language/Preprocessor/Cpphs/HashDefine.hs +6/−2
- Language/Preprocessor/Cpphs/MacroPass.hs +1/−0
- Makefile +1/−1
- cpphs.cabal +1/−1
- cpphs.hs +1/−1
- docs/index.html +13/−4
- tests/runtests +1/−0
- tests/undef.hs +4/−0
CHANGELOG view
@@ -1,3 +1,7 @@+Version 1.9+-----------+ * Bugfix for #undef.+ Version 1.8 ----------- * Bugfix for off-by-one error in line numbers with --include=file.
Language/Preprocessor/Cpphs/CppIfdef.hs view
@@ -20,7 +20,6 @@ import Language.Preprocessor.Cpphs.SymTab import Text.ParserCombinators.HuttonMeijer--- import HashDefine import Language.Preprocessor.Cpphs.Position (Posn,newfile,newline,newlines ,cppline,newpos) import Language.Preprocessor.Cpphs.ReadFirst (readFirst)@@ -245,6 +244,7 @@ Nothing -> sym Just (a@SymbolReplacement{}) -> recursivelyExpand st (replacement a) Just (a@MacroExpansion{}) -> expandMacro a args False+ Just (a@AntiDefined{}) -> name a recursivelyExpand :: SymTab HashDefine -> String -> String recursivelyExpand st inp =
Language/Preprocessor/Cpphs/HashDefine.hs view
@@ -26,6 +26,10 @@ { name :: String } | Pragma { name :: String }+ | AntiDefined+ { name :: String+ , linebreaks :: Int+ } | SymbolReplacement { name :: String , replacement :: String@@ -72,9 +76,9 @@ command ("line":xs) = Just (LineDrop ("#line"++concat xs)) command ("pragma":xs) = Just (Pragma ("#pragma"++concat xs)) command ("define":xs) = Just (((define . skip) xs) { linebreaks=count def })- command ("undef":xs) = Just (((undef . skip) xs) { linebreaks=count def })+ command ("undef":xs) = Just (((undef . skip) xs)) command _ = Nothing- undef (sym:_) = symbolReplacement { name=sym, replacement=sym }+ undef (sym:_) = AntiDefined { name=sym, linebreaks=0 } define (sym:xs) = case {-skip-} xs of ("(":ys) -> (macroHead sym [] . skip) ys ys -> symbolReplacement
Language/Preprocessor/Cpphs/MacroPass.hs view
@@ -100,6 +100,7 @@ Nothing -> x: macroProcess pr layout lang st ws Just hd -> case hd of+ AntiDefined {name=n} -> n: macroProcess pr layout lang st ws SymbolReplacement {replacement=r} -> let r' = if layout then r else filter (/='\n') r in -- one-level expansion only:
Makefile view
@@ -1,5 +1,5 @@ LIBRARY = cpphs-VERSION = 1.8+VERSION = 1.9 DIRS = Language/Preprocessor/Cpphs \ Text/ParserCombinators
cpphs.cabal view
@@ -1,5 +1,5 @@ Name: cpphs-Version: 1.8+Version: 1.9 Copyright: 2004-2009, Malcolm Wallace Build-Depends: base < 6, haskell98 License: LGPL
cpphs.hs view
@@ -19,7 +19,7 @@ import List ( isPrefixOf ) version :: String-version = "1.8"+version = "1.9" main :: IO () main = do
docs/index.html view
@@ -194,16 +194,16 @@ <b>Current stable version:</b> <p>-cpphs-1.8, release date 2009.08.06<br>+cpphs-1.9, release date 2009.09.07<br> By HTTP:-<a href="http://www.cs.york.ac.uk/fp/cpphs/cpphs-1.8.tar.gz">.tar.gz</a>,-<a href="http://www.cs.york.ac.uk/fp/cpphs/cpphs-1.8.zip">.zip</a>.+<a href="http://www.cs.york.ac.uk/fp/cpphs/cpphs-1.9.tar.gz">.tar.gz</a>,+<a href="http://www.cs.york.ac.uk/fp/cpphs/cpphs-1.9.zip">.zip</a>. <a href="http://www.haskell.org/fedora/">Fedora package</a>, <a href="http://packages.gentoo.org/packages/?category=dev-haskell;name=cpphs">Gentoo package</a>, <a href="http://www.freshports.org/devel/hs-cpphs/">FreeBSD port</a>, <a href="http://www.openbsd.org/cgi-bin/cvsweb/ports/devel/cpphs/">OpenBSD port</a>. <ul>-<li> Bugfix for off-by-one error in line numbers with --include=file.+<li> Bugfix for #undef. </ul> <p>@@ -225,6 +225,15 @@ <p> <b>Older versions:</b>++<p>+cpphs-1.8, release date 2009.08.06<br>+By HTTP:+<a href="http://www.cs.york.ac.uk/fp/cpphs/cpphs-1.8.tar.gz">.tar.gz</a>,+<a href="http://www.cs.york.ac.uk/fp/cpphs/cpphs-1.8.zip">.zip</a>.+<ul>+<li> Bugfix for off-by-one error in line numbers with --include=file.+</ul> <p> cpphs-1.7, release date 2009.06.22<br>
tests/runtests view
@@ -66,4 +66,5 @@ runtest "$CPPHS --include=inclusion preinclude" expect46 runtest "$CPPHS --unlit endcode-a" expect47 runtest "$CPPHS --unlit endcode-b" expect48+runtest "$CPPHS undef.hs" expect49 exit $FAIL
+ tests/undef.hs view
@@ -0,0 +1,4 @@+#define FOO 3+wibble FOO+#undef FOO+this is FOO