From 6a71648846f51fad1d9d3d9d964319de66b75e2f Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Sat, 8 Jun 2019 15:05:17 +1200 Subject: [PATCH] Model the tree being matched, to be converted from XML conduit. --- Stylish/Select.hs | 18 ++++++++++++++++++ stylish-haskell.cabal | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 Stylish/Select.hs diff --git a/Stylish/Select.hs b/Stylish/Select.hs new file mode 100644 index 0000000..f6bd2e8 --- /dev/null +++ b/Stylish/Select.hs @@ -0,0 +1,18 @@ +module Stylish.Select( + DocumentNode(..), + DocumentAttribute(..) + ) where + +data DocumentNode = DocumentNode { + parent :: DocumentNode, + prev :: DocumentNode, + name :: Text, + namespace :: Text, + attributes :: [DocumentAttribute] -- Sorted alphabetically by name. +} + +data DocumentAttribute = DocumentAttribute { + name :: Text, +-- namespace :: Text, -- TODO + value :: Text +} diff --git a/stylish-haskell.cabal b/stylish-haskell.cabal index 2f7c3ed..6175a45 100644 --- a/stylish-haskell.cabal +++ b/stylish-haskell.cabal @@ -48,7 +48,7 @@ cabal-version: >=1.10 library -- Modules exported by the library. - -- exposed-modules: + -- exposed-modules: Stylish.Select -- Modules included in this library but not exported. -- other-modules: -- 2.30.2