tools/pas2c/Pas2C.hs
changeset 13306 806347b3c978
parent 11840 24f309d75da8
child 13344 4f9108f82879
equal deleted inserted replaced
13305:859643473ef2 13306:806347b3c978
  1096     let f name = return $ text name <> parens (hsep $ punctuate (char ',') [e', e1', e2'])
  1096     let f name = return $ text name <> parens (hsep $ punctuate (char ',') [e', e1', e2'])
  1097     case lt of
  1097     case lt of
  1098          BTString -> f "fpcrtl_copy"
  1098          BTString -> f "fpcrtl_copy"
  1099          BTAString -> f "fpcrtl_copyA"
  1099          BTAString -> f "fpcrtl_copyA"
  1100          _ -> error $ "copy() called on " ++ show lt
  1100          _ -> error $ "copy() called on " ++ show lt
  1101      
  1101 
  1102 expr2C (BuiltInFunCall params ref) = do
  1102 expr2C (BuiltInFunCall params ref) = do
  1103     r <- ref2C ref
  1103     r <- ref2C ref
  1104     t <- gets lastType
  1104     t <- gets lastType
  1105     ps <- mapM expr2C params
  1105     ps <- mapM expr2C params
  1106     case t of
  1106     case t of
  1107         BTFunction _ _ _ t' -> do
  1107         BTFunction _ _ _ t' -> do
  1108             modify (\s -> s{lastType = t'})
  1108             modify (\s -> s{lastType = t'})
  1109         _ -> error $ "BuiltInFunCall lastType: " ++ show t
  1109         _ -> error $ "BuiltInFunCall `" ++ show ref ++ "`, lastType: " ++ show t
  1110     return $
  1110     return $
  1111         r <> parens (hsep . punctuate (char ',') $ ps)
  1111         r <> parens (hsep . punctuate (char ',') $ ps)
  1112 expr2C a = error $ "Don't know how to render " ++ show a
  1112 expr2C a = error $ "Don't know how to render " ++ show a
  1113 
  1113 
  1114 ref2CF :: Reference -> Bool -> State RenderState Doc
  1114 ref2CF :: Reference -> Bool -> State RenderState Doc