tools/pas2c/Pas2C.hs
changeset 13878 0ce8aad17c24
parent 13862 0ecf77e203c0
child 13887 5988e73080a3
equal deleted inserted replaced
13877:8c702a4839ec 13878:0ce8aad17c24
   610     initExpr Nothing = return $ empty
   610     initExpr Nothing = return $ empty
   611     initExpr (Just e) = liftM (text "=" <+>) (initExpr2C e)
   611     initExpr (Just e) = liftM (text "=" <+>) (initExpr2C e)
   612     varDeclDecision True True varStr expStr = varStr <+> expStr
   612     varDeclDecision True True varStr expStr = varStr <+> expStr
   613     varDeclDecision False True varStr expStr = if externVar then varStr else varStr <+> expStr
   613     varDeclDecision False True varStr expStr = if externVar then varStr else varStr <+> expStr
   614     varDeclDecision False False varStr expStr = varStr <+> expStr
   614     varDeclDecision False False varStr expStr = varStr <+> expStr
   615     varDeclDecision True False varStr expStr = varStr <+> expStr
   615     varDeclDecision True False _ _ = empty
   616     arrayDimension a = case a of
   616     arrayDimension a = case a of
   617         ArrayDecl Nothing t' -> let a' = arrayDimension t' in 
   617         ArrayDecl Nothing t' -> let a' = arrayDimension t' in 
   618                                    if a' > 3 then error "Dynamic array with dimension > 4 is not supported." else 1 + a'
   618                                    if a' > 3 then error "Dynamic array with dimension > 4 is not supported." else 1 + a'
   619         ArrayDecl _ _ -> error "Mixed dynamic array and static array are not supported."
   619         ArrayDecl _ _ -> error "Mixed dynamic array and static array are not supported."
   620         _ -> 0
   620         _ -> 0