tools/PascalParser.hs
changeset 6626 a447993f2ad7
parent 6618 2d3232069c4b
child 6826 8fadeefdd352
equal deleted inserted replaced
6625:2d8c5815292f 6626:a447993f2ad7
   111             return t
   111             return t
   112         char '='
   112         char '='
   113         comments
   113         comments
   114         e <- initExpression
   114         e <- initExpression
   115         comments
   115         comments
   116         return $ VarDeclaration False ([i], fromMaybe UnknownType t) (Just e)
   116         return $ VarDeclaration False ([i], fromMaybe (DeriveType e) t) (Just e)
   117         
   117         
   118 typeDecl = choice [
   118 typeDecl = choice [
   119     char '^' >> typeDecl >>= return . PointerTo
   119     char '^' >> typeDecl >>= return . PointerTo
   120     , try (string "shortstring") >> return (String 255)
   120     , try (string "shortstring") >> return (String 255)
   121     , try (string "string") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255
   121     , try (string "string") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255