tools/pas2c/PascalParser.hs
changeset 10111 459bc720cea1
parent 9954 bf51bc7e2808
child 10113 b26c2772e754
equal deleted inserted replaced
10110:a7aed2eea727 10111:459bc720cea1
   119         comments
   119         comments
   120         return $ VarDeclaration False (isNothing t) ([i], fromMaybe (DeriveType e) t) (Just e)
   120         return $ VarDeclaration False (isNothing t) ([i], fromMaybe (DeriveType e) t) (Just e)
   121 
   121 
   122 typeDecl = choice [
   122 typeDecl = choice [
   123     char '^' >> typeDecl >>= return . PointerTo
   123     char '^' >> typeDecl >>= return . PointerTo
   124     , try (string "shortstring") >> return (String 255)
   124     , try (string "shortstring") >> return String
   125     , try (string "string") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255
   125     , try (string "string") >> optionMaybe (brackets pas $ integer pas) >> return String
   126     , try (string "ansistring") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255
   126     , try (string "ansistring") >> optionMaybe (brackets pas $ integer pas) >> return String
   127     , arrayDecl
   127     , arrayDecl
   128     , recordDecl
   128     , recordDecl
   129     , setDecl
   129     , setDecl
   130     , functionType
   130     , functionType
   131     , sequenceDecl >>= return . Sequence
   131     , sequenceDecl >>= return . Sequence