{-# LINE 1 "XSLT.hs.neat" #-} -- Copyright 2014 Alvaro J. Genial [http://alva.ro]; see LICENSE file for more. module Text.Neat.Output.XSLT (outputXSLT) where import Text.Neat.Template import Text.Neat.Output instance Output File where output (File path block) = ({-# LINE 10 "XSLT.hs.neat" #-} "\n" ++ ({-# LINE 12 "XSLT.hs.neat" #-} output (block)) ++ {-# LINE 12 "XSLT.hs.neat" #-} "\n"){-# LINE 14 "XSLT.hs.neat" #-} instance Output Block where output (Block chunks) = ({-# LINE 17 "XSLT.hs.neat" #-} "" ++ ({-# LINE 18 "XSLT.hs.neat" #-} let _l = list (chunks) in if (not . null) _l then _l >>= \{-# LINE 18 "XSLT.hs.neat" #-} chunk -> ({-# LINE 18 "XSLT.hs.neat" #-} "" ++ ({-# LINE 19 "XSLT.hs.neat" #-} output (chunk)) ++ {-# LINE 19 "XSLT.hs.neat" #-} "") else []) ++ {-# LINE 20 "XSLT.hs.neat" #-} ""){-# LINE 21 "XSLT.hs.neat" #-} instance Output Chunk where output (Chunk location element) = ({-# LINE 24 "XSLT.hs.neat" #-} "" ++ ({-# LINE 25 "XSLT.hs.neat" #-} output (element)) ++ {-# LINE 25 "XSLT.hs.neat" #-} ""){-# LINE 26 "XSLT.hs.neat" #-} instance Output Location where output (Location file line) = ({-# LINE 29 "XSLT.hs.neat" #-} ""){-# LINE 29 "XSLT.hs.neat" #-} instance Output Value where output (Value _ value) = (({-# LINE 32 "XSLT.hs.neat" #-} output (value))){-# LINE 32 "XSLT.hs.neat" #-} instance Output Pattern where output (Pattern _ pattern) = (({-# LINE 35 "XSLT.hs.neat" #-} output (pattern))){-# LINE 35 "XSLT.hs.neat" #-} instance Output Element where output (Output value) = ({-# LINE 38 "XSLT.hs.neat" #-} "\n "){-# LINE 40 "XSLT.hs.neat" #-} output (Comment comment) = ({-# LINE 42 "XSLT.hs.neat" #-} "\n " ++ ({-# LINE 43 "XSLT.hs.neat" #-} output (comment)) ++ {-# LINE 43 "XSLT.hs.neat" #-} ""){-# LINE 44 "XSLT.hs.neat" #-} output (Define (Function location name pattern) block) = ({-# LINE 46 "XSLT.hs.neat" #-} "" ++ ({-# LINE 47 "XSLT.hs.neat" #-} output (location)) ++ {-# LINE 47 "XSLT.hs.neat" #-} "\n " ++ ({-# LINE 49 "XSLT.hs.neat" #-} output (block)) ++ {-# LINE 49 "XSLT.hs.neat" #-} "\n "){-# LINE 51 "XSLT.hs.neat" #-} output (Filter value block) = ({-# LINE 53 "XSLT.hs.neat" #-} "\n "){-# LINE 55 "XSLT.hs.neat" #-} output (For (Binding pattern value) block else') = ({-# LINE 57 "XSLT.hs.neat" #-} "\n \n \n " ++ ({-# LINE 61 "XSLT.hs.neat" #-} output (block)) ++ {-# LINE 61 "XSLT.hs.neat" #-} "\n \n " ++ ({-# LINE 64 "XSLT.hs.neat" #-} if (not . zero) (else') then ({-# LINE 64 "XSLT.hs.neat" #-} "\n " ++ ({-# LINE 65 "XSLT.hs.neat" #-} output (else')) ++ {-# LINE 65 "XSLT.hs.neat" #-} "") else []) ++ {-# LINE 66 "XSLT.hs.neat" #-} "\n "){-# LINE 68 "XSLT.hs.neat" #-} output (If value block else') = ({-# LINE 70 "XSLT.hs.neat" #-} "\n \n " ++ ({-# LINE 73 "XSLT.hs.neat" #-} output (block)) ++ {-# LINE 73 "XSLT.hs.neat" #-} "\n \n " ++ ({-# LINE 76 "XSLT.hs.neat" #-} if (not . zero) (else') then ({-# LINE 76 "XSLT.hs.neat" #-} "\n \n " ++ ({-# LINE 79 "XSLT.hs.neat" #-} output (block)) ++ {-# LINE 79 "XSLT.hs.neat" #-} "\n \n ") else []) ++ {-# LINE 82 "XSLT.hs.neat" #-} ""){-# LINE 83 "XSLT.hs.neat" #-} output (Switch value cases default') = ({-# LINE 85 "XSLT.hs.neat" #-} "\n " ++ ({-# LINE 87 "XSLT.hs.neat" #-} let _l = list (cases) in if (not . null) _l then _l >>= \{-# LINE 87 "XSLT.hs.neat" #-} (Case pattern block) -> ({-# LINE 87 "XSLT.hs.neat" #-} "\n " ++ ({-# LINE 89 "XSLT.hs.neat" #-} output (block)) ++ {-# LINE 89 "XSLT.hs.neat" #-} "\n ") else []) ++ {-# LINE 91 "XSLT.hs.neat" #-} "" ++ ({-# LINE 92 "XSLT.hs.neat" #-} if (not . zero) (default') then ({-# LINE 92 "XSLT.hs.neat" #-} "\n " ++ ({-# LINE 93 "XSLT.hs.neat" #-} output (default')) ++ {-# LINE 93 "XSLT.hs.neat" #-} "") else []) ++ {-# LINE 94 "XSLT.hs.neat" #-} "\n "){-# LINE 96 "XSLT.hs.neat" #-} output (With (Binding pattern value) block) = ({-# LINE 98 "XSLT.hs.neat" #-} "\n "){-# LINE 102 "XSLT.hs.neat" #-} output (Text text) = ({-# LINE 104 "XSLT.hs.neat" #-} "\n " ++ ({-# LINE 105 "XSLT.hs.neat" #-} output (text)) ++ {-# LINE 105 "XSLT.hs.neat" #-} ""){-# LINE 106 "XSLT.hs.neat" #-} outputXSLT :: File -> String outputXSLT = output