tools/pas2c/Pas2C.hs
changeset 10121 8b65699beb56
parent 10120 b7f632c12784
child 10124 aabd1b75d5a3
equal deleted inserted replaced
10120:b7f632c12784 10121:8b65699beb56
  1198     lt <- expr2C expr >> gets lastType
  1198     lt <- expr2C expr >> gets lastType
  1199     case (map toLower i, lt) of
  1199     case (map toLower i, lt) of
  1200         ("pchar", BTString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "_pchar" $ BTPointerTo BTChar))
  1200         ("pchar", BTString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "_pchar" $ BTPointerTo BTChar))
  1201         ("pchar", BTAString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "_pcharA" $ BTPointerTo BTChar))
  1201         ("pchar", BTAString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "_pcharA" $ BTPointerTo BTChar))
  1202         ("shortstring", BTPointerTo _) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "pchar2str" $ BTString))
  1202         ("shortstring", BTPointerTo _) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "pchar2str" $ BTString))
       
  1203         ("ansistring", BTString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "str2astr" $ BTAString))
  1203         (a, _) -> do
  1204         (a, _) -> do
  1204             e <- expr2C expr
  1205             e <- expr2C expr
  1205             t <- id2C IOLookup t'
  1206             t <- id2C IOLookup t'
  1206             return . parens $ parens t <> e
  1207             return . parens $ parens t <> e
  1207 ref2C (RefExpression expr) = expr2C expr
  1208 ref2C (RefExpression expr) = expr2C expr