tools/pas2c/Pas2C.hs
changeset 10127 7f29a65aa1e4
parent 10124 aabd1b75d5a3
child 10129 cd2a64a1f4aa
--- a/tools/pas2c/Pas2C.hs	Sun Feb 09 19:00:13 2014 +0100
+++ b/tools/pas2c/Pas2C.hs	Mon Feb 10 00:43:03 2014 +0400
@@ -1140,6 +1140,7 @@
          a -> error $ "Getting element of " ++ show a ++ "\nReference: " ++ show ae
     case t of
          BTString ->  return $ r <> text ".s" <> brackets e
+         BTAString ->  return $ r <> text ".s" <> brackets e
          _ -> return $ r <> brackets e
 ref2C (SimpleReference name) = id2C IOLookup name
 ref2C rf@(RecordField (Dereference ref1) ref2) = do
@@ -1202,6 +1203,7 @@
         ("pchar", BTAString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "_pcharA" $ BTPointerTo BTChar))
         ("shortstring", BTAString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "astr2str" $ BTString))
         ("shortstring", BTPointerTo _) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "pchar2str" $ BTString))
+        ("ansistring", BTPointerTo _) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "pchar2astr" $ BTAString))
         ("ansistring", BTString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "str2astr" $ BTAString))
         (a, _) -> do
             e <- expr2C expr