From: PHO Date: Tue, 9 Mar 2010 07:36:33 +0000 (+0900) Subject: No need to use xn. X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;p=hxt-compile.git No need to use xn. --- 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