From f0a21fa3ef20a7dc67a5b27bf36b6ce2e3ca2005 Mon Sep 17 00:00:00 2001 From: "A. R. Shajii" Date: Tue, 1 Feb 2022 11:15:22 -0500 Subject: [PATCH] clang-format --- codon/parser/ast/types.cpp | 3 ++- codon/parser/visitors/simplify/simplify_ctx.cpp | 4 ++-- codon/parser/visitors/simplify/simplify_stmt.cpp | 3 +-- codon/parser/visitors/typecheck/typecheck_expr.cpp | 6 ++++-- codon/parser/visitors/typecheck/typecheck_infer.cpp | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/codon/parser/ast/types.cpp b/codon/parser/ast/types.cpp index 7a3244a0..09fc633c 100644 --- a/codon/parser/ast/types.cpp +++ b/codon/parser/ast/types.cpp @@ -771,7 +771,8 @@ int CallableTrait::unify(Type *typ, Unification *us) { if (args[gi++]->unify(pf->args[pi + 1].get(), us) == -1) return -1; if (us && us->realizator && pf->canRealize()) { - // Realize if possible to allow deduction of return type [and possible unification!] + // Realize if possible to allow deduction of return type [and possible + // unification!] auto rf = us->realizator->realize(pf); pf->unify(rf.get(), us); } diff --git a/codon/parser/visitors/simplify/simplify_ctx.cpp b/codon/parser/visitors/simplify/simplify_ctx.cpp index 7587a6c2..0ddf3fda 100644 --- a/codon/parser/visitors/simplify/simplify_ctx.cpp +++ b/codon/parser/visitors/simplify/simplify_ctx.cpp @@ -24,8 +24,8 @@ SimplifyContext::SimplifyContext(std::string filename, Cache *cache) allowTypeOf(true), substitutions(nullptr) {} SimplifyContext::Base::Base(std::string name, std::shared_ptr ast, int attributes) - : name(move(name)), ast(move(ast)), attributes(attributes), - deducedMembers(nullptr), selfName() {} + : name(move(name)), ast(move(ast)), attributes(attributes), deducedMembers(nullptr), + selfName() {} std::shared_ptr SimplifyContext::add(SimplifyItem::Kind kind, const std::string &name, diff --git a/codon/parser/visitors/simplify/simplify_stmt.cpp b/codon/parser/visitors/simplify/simplify_stmt.cpp index 7fef1ad6..d1e420ce 100644 --- a/codon/parser/visitors/simplify/simplify_stmt.cpp +++ b/codon/parser/visitors/simplify/simplify_stmt.cpp @@ -569,8 +569,7 @@ void SimplifyVisitor::visit(FunctionStmt *stmt) { if (typeAst && (typeAst->isId("type") || typeAst->isId("TypeVar")) && deflt && deflt->getNone()) deflt = N("NoneType"); - args.emplace_back( - Param{std::string(stars, '*') + name, typeAst, deflt, a.generic}); + args.emplace_back(Param{std::string(stars, '*') + name, typeAst, deflt, a.generic}); if (a.generic) { if (a.type->getIndex() && a.type->getIndex()->expr->isId("Static")) ctx->add(SimplifyItem::Var, varName, name); diff --git a/codon/parser/visitors/typecheck/typecheck_expr.cpp b/codon/parser/visitors/typecheck/typecheck_expr.cpp index 7625dc38..bf32a655 100644 --- a/codon/parser/visitors/typecheck/typecheck_expr.cpp +++ b/codon/parser/visitors/typecheck/typecheck_expr.cpp @@ -1397,7 +1397,8 @@ ExprPtr TypecheckVisitor::transformCall(CallExpr *expr, const types::TypePtr &in // endswith(calleeFn->ast->name, ".__new__:0")) { // seqassert(expr->type->getRecord(), "expected a partial record"); // auto r = expr->type->getRecord(); - // expr->type = std::make_shared(r, ctx->cache->partials[r->name].first, + // expr->type = std::make_shared(r, + // ctx->cache->partials[r->name].first, // ctx->cache->partials[r->name].second); // } return nullptr; @@ -1648,7 +1649,8 @@ std::string TypecheckVisitor::generatePartialStub(const std::vector &mask, ctx->cache->partials[typeName] = {fn->generalize(0)->getFunc(), mask}; generateTupleStub(tupleSize + 2, typeName, {}, false); } - // LOG("[p] {} -> {}", typeName, ctx->cache->partials[typeName].first->debugString(1)); + // LOG("[p] {} -> {}", typeName, + // ctx->cache->partials[typeName].first->debugString(1)); return typeName; } diff --git a/codon/parser/visitors/typecheck/typecheck_infer.cpp b/codon/parser/visitors/typecheck/typecheck_infer.cpp index bf804274..b970dd40 100644 --- a/codon/parser/visitors/typecheck/typecheck_infer.cpp +++ b/codon/parser/visitors/typecheck/typecheck_infer.cpp @@ -32,8 +32,8 @@ types::TypePtr TypecheckVisitor::realize(types::TypePtr typ) { } else if (auto c = typ->getClass()) { auto t = realizeType(c.get()); if (auto p = typ->getPartial()) { - // if (auto rt = realize(p->func)) - // unify(rt, p->func); + // if (auto rt = realize(p->func)) + // unify(rt, p->func); return std::make_shared(t->getRecord(), p->func, p->known); } return t;