diff options
Diffstat (limited to 'write.cpp')
-rw-r--r-- | write.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -20,23 +20,23 @@ ostream& operator<<(ostream& out, const AST* ast) { - const ALiteral<float>* flit = dynamic_cast<const ALiteral<float>*>(ast); + const ALiteral<float>* flit = ast->to<const ALiteral<float>*>(); if (flit) return out << showpoint << flit->val; - const ALiteral<int32_t>* ilit = dynamic_cast<const ALiteral<int32_t>*>(ast); + const ALiteral<int32_t>* ilit = ast->to<const ALiteral<int32_t>*>(); if (ilit) return out << ilit->val; - const ALiteral<bool>* blit = dynamic_cast<const ALiteral<bool>*>(ast); + const ALiteral<bool>* blit = ast->to<const ALiteral<bool>*>(); if (blit) return out << (blit->val ? "#t" : "#f"); - const ASymbol* sym = dynamic_cast<const ASymbol*>(ast); + const ASymbol* sym = ast->to<const ASymbol*>(); if (sym) return out << sym->cppstr; - const AType* type = dynamic_cast<const AType*>(ast); + const AType* type = ast->to<const AType*>(); if (type) { switch (type->kind) { case AType::VAR: return out << "?" << type->id; @@ -45,7 +45,7 @@ operator<<(ostream& out, const AST* ast) } } - const ATuple* tup = dynamic_cast<const ATuple*>(ast); + const ATuple* tup = ast->to<const ATuple*>(); if (tup) { out << "("; for (size_t i = 0; i != tup->size(); ++i) |