hexml 0.3.2 → 0.3.3
raw patch · 5 files changed
+9/−4 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES.txt +2/−0
- README.md +2/−0
- cbits/hexml.c +1/−1
- hexml.cabal +2/−2
- src/Main.hs +2/−1
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for Hexml +0.3.3+ #13, allow the . character in tags and attributes 0.3.2 #10, mark the small fast FFI calls as "unsafe" (up to 10x faster) 0.3.1
README.md view
@@ -11,3 +11,5 @@ Hexml may be suitable if you want to quickly parse XML, from known sources, and a full XML parser has been shown to be a bottleneck. As an alternative to hexml, which supports things like entities but is still pretty fast, see [Pugixml](http://pugixml.org/) (with a [Haskell binding](https://hackage.haskell.org/package/pugixml)). Hexml is tested with [AFL](http://lcamtuf.coredump.cx/afl/).++If you want lenses for Hexml, see [hexml-lens](http://hackage.haskell.org/package/hexml-lens).
cbits/hexml.c view
@@ -233,7 +233,7 @@ for (int i = 0; i < 256; i++) { bool name1 = i == ':' || i == '_' || (i >= 'a' && i <= 'z') || (i >= 'A' && i <= 'Z');- bool name = name1 || i == '-' || (i >= '0' && i <= '9');+ bool name = name1 || i == '-' || i == '.' || (i >= '0' && i <= '9'); bool space = i == ' ' || i == '\t' || i == '\r' || i == '\n'; parse_table[i] = (name1 ? tag_name1 : 0) | (name ? tag_name : 0) | (space ? tag_space : 0); }
hexml.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.18 build-type: Simple name: hexml-version: 0.3.2+version: 0.3.3 license: BSD3 license-file: LICENSE category: XML@@ -13,7 +13,7 @@ An XML DOM-style parser, that only parses a subset of XML, but is designed to be fast. homepage: https://github.com/ndmitchell/hexml#readme bug-reports: https://github.com/ndmitchell/hexml/issues-tested-with: GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3+tested-with: GHC==8.2.1, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3 extra-doc-files: README.md CHANGES.txt
src/Main.hs view
@@ -18,6 +18,7 @@ ,(False, "<test></more>") ,(False, "<test") ,(True, "<?xml version=\"1.1\"?>\n<greeting>Hello, world!</greeting>")+ ,(True, "<foo bar.baz=\"qux\"></foo>") ] main :: IO ()@@ -74,7 +75,7 @@ "</" <> name x <> ">" attr (Attribute a b) = validName a <> "=\"" <> validAttr b <> "\"" - validName x | BS.all (\x -> isAlphaNum x || x `elem` ("-:_" :: String)) x = x+ validName x | BS.all (\x -> isAlphaNum x || x `elem` ("-.:_" :: String)) x = x | otherwise = error "Invalid name" validAttr x | BS.notElem '\"' x = x | otherwise = error "Invalid attribute"