graphviz 2999.5.1.0 → 2999.5.1.1
raw patch · 4 files changed
+27/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Changelog +7/−0
- Data/GraphViz/Types/Internal.hs +17/−0
- Data/GraphViz/Types/Printing.hs +2/−1
- graphviz.cabal +1/−1
Changelog view
@@ -1,3 +1,10 @@+Changes in 2999.5.1.1+=====================++* When used as labels, etc., the Dot keywords node, edge, graph,+ digraph, subgraph, and strict need to be quoted. Spotted by+ Kathleen Fisher.+ Changes in 2999.5.1.0 =====================
Data/GraphViz/Types/Internal.hs view
@@ -12,8 +12,12 @@ import Data.Char( isAsciiUpper , isAsciiLower , isDigit+ , toLower ) +import qualified Data.Set as Set+import Data.Set(Set)+ isIDString :: String -> Bool isIDString [] = True isIDString (f:os) = frstIDString f@@ -55,6 +59,19 @@ descapeQuotes [] = [] descapeQuotes ('\\':'"':str) = '"' : descapeQuotes str descapeQuotes (c:str) = c : descapeQuotes str++isKeyword :: String -> Bool+isKeyword = flip Set.member keywords . map toLower++-- | The following are Dot keywords and are not valid as labels, etc. unquoted.+keywords :: Set String+keywords = Set.fromList [ "node"+ , "edge"+ , "graph"+ , "digraph"+ , "subgraph"+ , "strict"+ ] -- | Fold over 'Bool's. bool :: a -> a -> Bool -> a
Data/GraphViz/Types/Printing.hs view
@@ -134,9 +134,10 @@ | isNumString str = text str | otherwise = text $ escapeQuotes str --- | Escape quotes and quote Strings that need them.+-- | Escape quotes and quote Strings that need them (including keywords). qtString :: String -> DotCode qtString str+ | isKeyword str = doubleQuotes $ text str | isIDString str = text str | isNumString str = text str -- Don't use unqtString as it re-runs isIDString
graphviz.cabal view
@@ -1,5 +1,5 @@ Name: graphviz-Version: 2999.5.1.0+Version: 2999.5.1.1 Stability: Beta Synopsis: GraphViz bindings for Haskell. Description: Provides convenient functions to convert FGL