language-c-quote 0.11.6.1 → 0.11.6.2
raw patch · 5 files changed
+50/−12 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Language/C/Parser/Parser.y +3/−2
- dist/build/Language/C/Parser/Lexer.hs +20/−3
- dist/build/Language/C/Parser/Parser.hs +5/−5
- language-c-quote.cabal +1/−1
- tests/unit/Main.hs +21/−1
Language/C/Parser/Parser.y view
@@ -3995,8 +3995,9 @@ throw $ ParserException loc $ text errMsg mkBlock :: [BlockItem] -> SrcLoc -> Stm-mkBlock [BlockStm stm] _ = stm-mkBlock items sloc = Block items sloc+mkBlock items@[BlockStm AntiStms{}] sloc = Block items sloc+mkBlock [BlockStm stm] _ = stm+mkBlock items sloc = Block items sloc mkBlockItems :: Stm -> [BlockItem] mkBlockItems (Block items _) = items
dist/build/Language/C/Parser/Lexer.hs view
@@ -625,8 +625,7 @@ {-# LINE 9 "<command-line>" #-}-{-# LINE 1 "/opt/modules/ghc/8.0.0.20160421/lib/ghc-8.0.0.20160421/include/ghcversion.h" #-}-+{-# LINE 1 "/opt/modules/ghc/8.0.1/lib/ghc-8.0.1/include/ghcversion.h" #-} @@ -645,7 +644,25 @@ {-# LINE 9 "<command-line>" #-}-{-# LINE 1 "/tmp/ghc23018_0/ghc_2.h" #-}+{-# LINE 1 "/tmp/ghc19004_0/ghc_2.h" #-}++++++++++++++++++
dist/build/Language/C/Parser/Parser.hs view
@@ -11682,8 +11682,9 @@ throw $ ParserException loc $ text errMsg mkBlock :: [BlockItem] -> SrcLoc -> Stm-mkBlock [BlockStm stm] _ = stm-mkBlock items sloc = Block items sloc+mkBlock items@[BlockStm AntiStms{}] sloc = Block items sloc+mkBlock [BlockStm stm] _ = stm+mkBlock items sloc = Block items sloc mkBlockItems :: Stm -> [BlockItem] mkBlockItems (Block items _) = items@@ -11782,8 +11783,7 @@ {-# LINE 11 "<command-line>" #-}-{-# LINE 1 "/opt/modules/ghc/8.0.0.20160421/lib/ghc-8.0.0.20160421/include/ghcversion.h" #-}-+{-# LINE 1 "/opt/modules/ghc/8.0.1/lib/ghc-8.0.1/include/ghcversion.h" #-} @@ -11802,7 +11802,7 @@ {-# LINE 11 "<command-line>" #-}-{-# LINE 1 "/tmp/ghc22745_0/ghc_2.h" #-}+{-# LINE 1 "/tmp/ghc18285_0/ghc_2.h" #-}
language-c-quote.cabal view
@@ -1,5 +1,5 @@ name: language-c-quote-version: 0.11.6.1+version: 0.11.6.2 cabal-version: >= 1.10 license: BSD3 license-file: LICENSE
tests/unit/Main.hs view
@@ -7,6 +7,7 @@ import Test.HUnit (Assertion, (@?=)) import qualified Data.ByteString.Char8 as B+import Data.Char (isSpace) import Data.Loc (SrcLoc, noLoc, startPos) import Control.Exception (SomeException) import Language.C.Quote.C@@ -430,7 +431,8 @@ regressionTests :: Test regressionTests = testGroup "Regressions"- [ issue64+ [ issue68+ , issue64 , testCase "pragmas" test_pragmas , issue48 , testCase "Issue #44" issue44@@ -458,6 +460,15 @@ noLoc ] + issue68 :: Test+ issue68 = testCase "Issue #68"$+ simpleRender (ppr [cstm|if (!initialized) { $stms:init_stms }|])+ @?=+ "if (!initialized) { return; }"+ where+ init_stms :: [C.Stm]+ init_stms = [[cstm|return;|]]+ issue64 :: Test issue64 = testGroup "Issue #64" [ testCase "-($int:i)" test_issue64_1@@ -541,3 +552,12 @@ C.Type (C.DeclSpec [] [] (C.Tlong_double_Imaginary noLoc) noLoc) (C.DeclRoot noLoc) noLoc++-- | Render a document as a single line.+simpleRender :: Doc -> String+simpleRender doc =+ map space2space (displayS (renderCompact doc) "")+ where+ space2space :: Char -> Char+ space2space c | isSpace c = ' '+ | otherwise = c