diff --git a/compiler/core/pandagen.cpp b/compiler/core/pandagen.cpp index 7d58fa71c45b4622695a76884a4c7035854e2eac..d4ff04eef6ad84d07c63c3b264d6773894c70c77 100644 --- a/compiler/core/pandagen.cpp +++ b/compiler/core/pandagen.cpp @@ -887,22 +887,22 @@ void PandaGen::Call(const ir::AstNode *node, VReg startReg, size_t argCount) VReg callee = startReg; switch (argCount) { - case 0: { // 0 args + case 0: { // 0 args ra_.Emit(node, callee); break; } - case 1: { // 1 arg + case 1: { // 1 arg VReg arg0 = callee + 1; ra_.Emit(node, callee, arg0); break; } - case 2: { // 2 args + case 2: { // 2 args VReg arg0 = callee + 1; VReg arg1 = arg0 + 1; ra_.Emit(node, callee, arg0, arg1); break; } - case 3: { // 3 args + case 3: { // 3 args VReg arg0 = callee + 1; VReg arg1 = arg0 + 1; VReg arg2 = arg1 + 1; diff --git a/compiler/core/pandagen.h b/compiler/core/pandagen.h index eefd2e4b24180c09cf99b988a6a7f24cd2927186..6041544cfb62254a1200217d303753fa5f8646dc 100644 --- a/compiler/core/pandagen.h +++ b/compiler/core/pandagen.h @@ -192,7 +192,7 @@ public: VReg LexEnv() const; bool FunctionHasFinalizer() const; - void FunctionInit(CatchTable* catchTable); + void FunctionInit(CatchTable *catchTable); void FunctionEnter(); void FunctionExit(); diff --git a/ir/expressions/arrayExpression.h b/ir/expressions/arrayExpression.h index eeefb58d668fc1b0b2e540108cb8aaa423b0b9a8..bd9265db3a83fe204f35433952b95276fabb3161 100644 --- a/ir/expressions/arrayExpression.h +++ b/ir/expressions/arrayExpression.h @@ -34,10 +34,7 @@ namespace panda::es2panda::ir { class ArrayExpression : public Expression { public: explicit ArrayExpression(AstNodeType nodeType, ArenaVector &&elements, bool trailingComma) - : Expression(nodeType), - elements_(std::move(elements)), - typeAnnotation_(nullptr), - trailingComma_(trailingComma) + : Expression(nodeType), elements_(std::move(elements)), typeAnnotation_(nullptr), trailingComma_(trailingComma) { } diff --git a/ir/expressions/memberExpression.h b/ir/expressions/memberExpression.h index 8fbac5d816ceb788a8be2810b49a028a8a5dafbf..4648b7e5f279a88fc68250137cc9e6bbe2d94f76 100644 --- a/ir/expressions/memberExpression.h +++ b/ir/expressions/memberExpression.h @@ -35,8 +35,8 @@ class MemberExpression : public Expression { public: enum class MemberExpressionKind { ELEMENT_ACCESS, PROPERTY_ACCESS }; - explicit MemberExpression(Expression *object, Expression *property, MemberExpressionKind kind, - bool computed, bool optional) + explicit MemberExpression(Expression *object, Expression *property, MemberExpressionKind kind, bool computed, + bool optional) : Expression(AstNodeType::MEMBER_EXPRESSION), object_(object), property_(property), diff --git a/ir/expressions/taggedTemplateExpression.h b/ir/expressions/taggedTemplateExpression.h index f1a0131631801066a51f6c44e4ae384bbce7ae3f..84a4043c8e41a7607be796eb105ad23def590515 100644 --- a/ir/expressions/taggedTemplateExpression.h +++ b/ir/expressions/taggedTemplateExpression.h @@ -34,8 +34,7 @@ class TSTypeParameterInstantiation; class TaggedTemplateExpression : public Expression { public: - explicit TaggedTemplateExpression(Expression *tag, TemplateLiteral *quasi, - TSTypeParameterInstantiation *typeParams) + explicit TaggedTemplateExpression(Expression *tag, TemplateLiteral *quasi, TSTypeParameterInstantiation *typeParams) : Expression(AstNodeType::TAGGED_TEMPLATE_EXPRESSION), tag_(tag), quasi_(quasi), typeParams_(typeParams) { } diff --git a/ir/expressions/updateExpression.h b/ir/expressions/updateExpression.h index 30514793684f53515cf5022b0bee57b420e792b3..6ba1194f3e1b6fae7d5979de3c68e0230ea584cb 100644 --- a/ir/expressions/updateExpression.h +++ b/ir/expressions/updateExpression.h @@ -32,10 +32,7 @@ namespace panda::es2panda::ir { class UpdateExpression : public Expression { public: explicit UpdateExpression(Expression *argument, lexer::TokenType updateOperator, bool isPrefix) - : Expression(AstNodeType::UPDATE_EXPRESSION), - argument_(argument), - operator_(updateOperator), - prefix_(isPrefix) + : Expression(AstNodeType::UPDATE_EXPRESSION), argument_(argument), operator_(updateOperator), prefix_(isPrefix) { ASSERT(updateOperator == lexer::TokenType::PUNCTUATOR_PLUS_PLUS || updateOperator == lexer::TokenType::PUNCTUATOR_MINUS_MINUS); diff --git a/ir/ts/tsArrayType.h b/ir/ts/tsArrayType.h index 6d1e68363ab1f0630fb60e82c6542d54bb6c7644..3e550e6cdc26501d0799128f44e71dd90a25dcab 100644 --- a/ir/ts/tsArrayType.h +++ b/ir/ts/tsArrayType.h @@ -31,9 +31,7 @@ namespace panda::es2panda::ir { class TSArrayType : public Expression { public: - explicit TSArrayType(Expression *elementType) : Expression(AstNodeType::TS_ARRAY_TYPE), elementType_(elementType) - { - } + explicit TSArrayType(Expression *elementType) : Expression(AstNodeType::TS_ARRAY_TYPE), elementType_(elementType) {} const Expression *ElementType() const { diff --git a/ir/ts/tsInferType.h b/ir/ts/tsInferType.h index 9eead52a34e2e134eaa01f503b366a20fefbb1cf..a454774c59ab9068a7c7848da25b08a4a014aa00 100644 --- a/ir/ts/tsInferType.h +++ b/ir/ts/tsInferType.h @@ -33,9 +33,7 @@ class TSTypeParameter; class TSInferType : public Expression { public: - explicit TSInferType(TSTypeParameter *typeParam) : Expression(AstNodeType::TS_INFER_TYPE), typeParam_(typeParam) - { - } + explicit TSInferType(TSTypeParameter *typeParam) : Expression(AstNodeType::TS_INFER_TYPE), typeParam_(typeParam) {} const TSTypeParameter *TypeParam() const { diff --git a/ir/ts/tsNamedTupleMember.h b/ir/ts/tsNamedTupleMember.h index 8881cd48527709d56e4862e79bd2919f17d5b736..9c900a370a0fb30f1d74496f93118064ef562446 100644 --- a/ir/ts/tsNamedTupleMember.h +++ b/ir/ts/tsNamedTupleMember.h @@ -32,10 +32,7 @@ namespace panda::es2panda::ir { class TSNamedTupleMember : public Expression { public: explicit TSNamedTupleMember(Expression *label, Expression *elementType, bool optional) - : Expression(AstNodeType::TS_NAMED_TUPLE_MEMBER), - label_(label), - elementType_(elementType), - optional_(optional) + : Expression(AstNodeType::TS_NAMED_TUPLE_MEMBER), label_(label), elementType_(elementType), optional_(optional) { } diff --git a/ir/ts/tsParameterProperty.h b/ir/ts/tsParameterProperty.h index 635ec0a45523ce68e517b17b03c473263d138584..918e3dfbdac497b861040571101b2e0379febc7a 100644 --- a/ir/ts/tsParameterProperty.h +++ b/ir/ts/tsParameterProperty.h @@ -33,8 +33,8 @@ enum class AccessibilityOption { NO_OPTS, PUBLIC, PRIVATE, PROTECTED }; class TSParameterProperty : public Expression { public: - explicit TSParameterProperty(AccessibilityOption accessibility, Expression *parameter, bool readonly, - bool isStatic, bool isExport) + explicit TSParameterProperty(AccessibilityOption accessibility, Expression *parameter, bool readonly, bool isStatic, + bool isExport) : Expression(AstNodeType::TS_PARAMETER_PROPERTY), accessibility_(accessibility), parameter_(parameter), diff --git a/ir/ts/tsSignatureDeclaration.h b/ir/ts/tsSignatureDeclaration.h index 15ba36862ee623f6471b14490308d8a7465cc151..85a8fe62853c2e6b35849458c72cb2fd9404513d 100644 --- a/ir/ts/tsSignatureDeclaration.h +++ b/ir/ts/tsSignatureDeclaration.h @@ -40,8 +40,8 @@ public: enum class TSSignatureDeclarationKind { CALL_SIGNATURE, CONSTRUCT_SIGNATURE }; explicit TSSignatureDeclaration(binder::Scope *scope, TSSignatureDeclarationKind kind, - TSTypeParameterDeclaration *typeParams, - ArenaVector &¶ms, Expression *returnTypeAnnotation) + TSTypeParameterDeclaration *typeParams, ArenaVector &¶ms, + Expression *returnTypeAnnotation) : Expression(AstNodeType::TS_SIGNATURE_DECLARATION), scope_(scope), kind_(kind), diff --git a/ir/ts/tsTypeAliasDeclaration.h b/ir/ts/tsTypeAliasDeclaration.h index 6d28ef0ed23d39662373e12f448719f0c719019c..f882d51491ad3140682a4f240c06c1169ae877c3 100644 --- a/ir/ts/tsTypeAliasDeclaration.h +++ b/ir/ts/tsTypeAliasDeclaration.h @@ -38,8 +38,8 @@ class TSTypeParameterDeclaration; class TSTypeAliasDeclaration : public Statement { public: - explicit TSTypeAliasDeclaration(Identifier *id, TSTypeParameterDeclaration *typeParams, - Expression *typeAnnotation, bool declare) + explicit TSTypeAliasDeclaration(Identifier *id, TSTypeParameterDeclaration *typeParams, Expression *typeAnnotation, + bool declare) : Statement(AstNodeType::TS_TYPE_ALIAS_DECLARATION), id_(id), typeParams_(typeParams), diff --git a/parser/expressionParser.cpp b/parser/expressionParser.cpp index 34bb768e9109427fc6fb839cb68b806ecf515744..f3db9c0354ad0562dc84c431b5bba5d8c34c655e 100644 --- a/parser/expressionParser.cpp +++ b/parser/expressionParser.cpp @@ -1164,7 +1164,7 @@ static size_t GetOperatorPrecedence(lexer::TokenType operatorType) return precedence; } default: { - UNREACHABLE(); + UNREACHABLE(); } } } diff --git a/typescript/types/type.h b/typescript/types/type.h index dc9863ffe15f7efa6348c2843eed4a12943ffd6c..058c2ec7d16890a4ce9c25b6e6afce029bc04f13 100644 --- a/typescript/types/type.h +++ b/typescript/types/type.h @@ -46,21 +46,21 @@ public: virtual ~Type() = default; #define TYPE_IS_CHECKS(typeFlag, typeName) \ - bool Is##typeName() const \ - { \ - return HasTypeFlag(typeFlag); \ + bool Is##typeName() const \ + { \ + return HasTypeFlag(typeFlag); \ } TYPE_MAPPING(TYPE_IS_CHECKS) #undef DECLARE_IS_CHECKS -#define TYPE_AS_CASTS(typeFlag, typeName) \ - typeName *As##typeName() \ - { \ +#define TYPE_AS_CASTS(typeFlag, typeName) \ + typeName *As##typeName() \ + { \ ASSERT(Is##typeName()); \ return reinterpret_cast(this); \ - } \ - const typeName *As##typeName() const \ - { \ + } \ + const typeName *As##typeName() const \ + { \ ASSERT(Is##typeName()); \ return reinterpret_cast(this); \ } diff --git a/typescript/types/typeMapping.h b/typescript/types/typeMapping.h index 85383ee2ae894b89901ceec217cea3f08dd4c0e1..3bfe322458ac4a604dec496accb8e291f8d6b3ab 100644 --- a/typescript/types/typeMapping.h +++ b/typescript/types/typeMapping.h @@ -42,7 +42,7 @@ _(TypeFlag::TYPE_REFERENCE, TypeReference) \ _(TypeFlag::NON_PRIMITIVE, NonPrimitiveType) -#define OBJECT_TYPE_MAPPING(_) \ +#define OBJECT_TYPE_MAPPING(_) \ _(ObjectType::ObjectTypeKind::FUNCTION, FunctionType) \ _(ObjectType::ObjectTypeKind::TUPLE, TupleType) \ _(ObjectType::ObjectTypeKind::LITERAL, ObjectLiteralType) \