tools/PascalParser.hs
changeset 6875 6528171ce36d
parent 6858 608c8b057c3b
child 6891 ab9843957664
equal deleted inserted replaced
6874:b9e2e509a42d 6875:6528171ce36d
   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 (DeriveType e) t) (Just e)
   116         return $ VarDeclaration (isNothing t) ([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