# HG changeset patch # User unc0rr # Date 1391713355 -14400 # Node ID 459bc720cea19d9103eb60776b9cbda70e07cb81 # Parent a7aed2eea7278762d94e7f8f105697adeec9cc81 Drop support for other string types than string255 diff -r a7aed2eea727 -r 459bc720cea1 tools/pas2c/Pas2C.hs --- a/tools/pas2c/Pas2C.hs Thu Feb 06 19:05:22 2014 +0100 +++ b/tools/pas2c/Pas2C.hs Thu Feb 06 23:02:35 2014 +0400 @@ -421,7 +421,7 @@ resolveType (DeriveType (BuiltInFunction{})) = return (BTInt True) resolveType (DeriveType (InitReference (Identifier{}))) = return BTBool -- TODO: derive from actual type resolveType (DeriveType _) = return BTUnknown -resolveType (String _) = return BTString +resolveType String = return BTString resolveType VoidType = return BTVoid resolveType (Sequence ids) = return $ BTEnum $ map (\(Identifier i _) -> map toLower i) ids resolveType (RangeType _) = return $ BTVoid @@ -713,7 +713,7 @@ return r where type2C' VoidType = return (text "void" <+>) - type2C' (String l) = return (text "string255" <+>)--return (text ("string" ++ show l) <+>) + type2C' String = return (text "string255" <+>)--return (text ("string" ++ show l) <+>) type2C' (PointerTo (SimpleType i)) = do i' <- id2C IODeferred i lt <- gets lastType diff -r a7aed2eea727 -r 459bc720cea1 tools/pas2c/PascalParser.hs --- a/tools/pas2c/PascalParser.hs Thu Feb 06 19:05:22 2014 +0100 +++ b/tools/pas2c/PascalParser.hs Thu Feb 06 23:02:35 2014 +0400 @@ -121,9 +121,9 @@ typeDecl = choice [ char '^' >> typeDecl >>= return . PointerTo - , try (string "shortstring") >> return (String 255) - , try (string "string") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255 - , try (string "ansistring") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255 + , try (string "shortstring") >> return String + , try (string "string") >> optionMaybe (brackets pas $ integer pas) >> return String + , try (string "ansistring") >> optionMaybe (brackets pas $ integer pas) >> return String , arrayDecl , recordDecl , setDecl diff -r a7aed2eea727 -r 459bc720cea1 tools/pas2c/PascalUnitSyntaxTree.hs --- a/tools/pas2c/PascalUnitSyntaxTree.hs Thu Feb 06 19:05:22 2014 +0100 +++ b/tools/pas2c/PascalUnitSyntaxTree.hs Thu Feb 06 23:02:35 2014 +0400 @@ -28,7 +28,7 @@ | ArrayDecl (Maybe Range) TypeDecl | RecordType [TypeVarDeclaration] (Maybe [[TypeVarDeclaration]]) | PointerTo TypeDecl - | String Integer + | String | Set TypeDecl | FunctionType TypeDecl [TypeVarDeclaration] | DeriveType InitExpression