From 5c37ddeda538fb5feb7291a9364d0d130c34f56d Mon Sep 17 00:00:00 2001 From: PHO Date: Tue, 9 Mar 2010 16:36:33 +0900 Subject: [PATCH] No need to use xn. --- Text/XML/HXT/Compilation/XmlTree.hs | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/Text/XML/HXT/Compilation/XmlTree.hs b/Text/XML/HXT/Compilation/XmlTree.hs index 1538329..42db1a6 100644 --- a/Text/XML/HXT/Compilation/XmlTree.hs +++ b/Text/XML/HXT/Compilation/XmlTree.hs @@ -19,7 +19,7 @@ compileXmlTree t = let node = compileXNode (getNode t) children = HsList (map compileXmlTree (getChildren t)) in - xn "mkTree" $: HsParen node $: children + unq "mkTree" $: HsParen node $: children compileXmlTrees :: XmlTrees -> HsExp @@ -27,16 +27,16 @@ compileXmlTrees = HsList . map compileXmlTree compileXNode :: XNode -> HsExp -compileXNode (XText s) = xn "mkText" $: litStr s -compileXNode (XCharRef n) = xn "mkCharRef" $: litInt n -compileXNode (XEntityRef s) = xn "mkEntityRef" $: litStr s -compileXNode (XCmt s) = xn "mkCmt" $: litStr s -compileXNode (XCdata s) = xn "mkCdata" $: litStr s -compileXNode (XPi qn ts) = xn "mkPi" $: HsParen (compileQName qn) $: compileXmlTrees ts -compileXNode (XTag qn ts) = xn "mkElementNode" $: HsParen (compileQName qn) $: compileXmlTrees ts -compileXNode (XDTD de as) = xn "mkDTDNode" $: compileDTDElem de $: compileAttributes as -compileXNode (XAttr qn) = xn "mkAttrNode" $: HsParen (compileQName qn) -compileXNode (XError n s) = xn "mkError" $: litInt n $: litStr s +compileXNode (XText s) = unq "mkText" $: litStr s +compileXNode (XCharRef n) = unq "mkCharRef" $: litInt n +compileXNode (XEntityRef s) = unq "mkEntityRef" $: litStr s +compileXNode (XCmt s) = unq "mkCmt" $: litStr s +compileXNode (XCdata s) = unq "mkCdata" $: litStr s +compileXNode (XPi qn ts) = unq "mkPi" $: HsParen (compileQName qn) $: compileXmlTrees ts +compileXNode (XTag qn ts) = unq "mkElementNode" $: HsParen (compileQName qn) $: compileXmlTrees ts +compileXNode (XDTD de as) = unq "mkDTDNode" $: compileDTDElem de $: compileAttributes as +compileXNode (XAttr qn) = unq "mkAttrNode" $: HsParen (compileQName qn) +compileXNode (XError n s) = unq "mkError" $: litInt n $: litStr s compileDTDElem :: DTDElem -> HsExp @@ -59,11 +59,6 @@ compileAttributes = HsList . map compileAttr compileAttr (k, v) = HsTuple [ litStr k, litStr v ] - -xn :: String -> HsExp ---xn = HsVar . Qual (Module "XN") . HsIdent -xn = unq - unq :: String -> HsExp unq = HsVar . UnQual . HsIdent -- 2.40.0