CurryInfo: currypp-3.2.0 / CPP.ICode.TransICode.concatAll

definition: Info
 
concatAll :: [StandardToken] -> String
concatAll []      = ""
concatAll (t1:tks) = getCode t1 ++ (concatAllHelper
                                   (getIdentPos t1)
                                   (containsDSL t1)
                                   tks)
  where
    concatAllHelper :: Pos -> Bool -> [StandardToken] -> String
    concatAllHelper _ _ []        = ""
    concatAllHelper op b (t:toks) =
      let s      = getCode t
          p      = getIdentPos t
         -- if generated dsl code was processed before
      in if b
        then
          let lnDiff = lnDifference op p
          in
            -- if the first word of s was in a newline after the dsl
            if (null s)
              then genLines lnDiff ++ concatAllHelper p (containsDSL t) toks
              else
                if (head s == '\n')
                      then (genLines lnDiff ++ s
                            ++ concatAllHelper p (containsDSL t) toks)
                  -- If the first word of s was in the last line of the dsl.
                      else
                        let (headLine,restOfCurry) = splitByLine s
                        in
                            headLine ++ genLines lnDiff ++ restOfCurry
                            ++ concatAllHelper p (containsDSL t) toks
        else (s ++ concatAllHelper p (containsDSL t) toks)
demand: Info
 argument 1
deterministic: Info
 deterministic operation
documentation: Info
 
Concatenates the result of the translation process, inserting newlines
and offsets if necessary
@param tks - A list of StandardTokens containing the results
@result    - The resulting program code
failfree: Info
 _
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {({[]}) |-> {[]} || ({:}) |-> _}
name: Info
 concatAll
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 [CPP.ICode.ParseTypes.StandardToken] -> String
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term