From 35ed8f15e100c2fe1958e9dd7ce2af7b6063838f Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Thu, 18 Apr 2024 21:39:32 +0200 Subject: [PATCH] fixed TypedefFlag --- .haxerc | 2 +- src/checkstyle/checks/Check.hx | 4 ++-- src/checkstyle/checks/naming/ConstantNameCheck.hx | 2 +- src/checkstyle/checks/naming/MemberNameCheck.hx | 4 ++-- src/checkstyle/checks/naming/MethodNameCheck.hx | 4 ++-- src/checkstyle/checks/naming/NameCheckBase.hx | 2 +- src/checkstyle/checks/naming/ParameterNameCheck.hx | 4 ++-- src/checkstyle/checks/naming/TypeNameCheck.hx | 4 ++-- src/checkstyle/utils/ComplexTypeUtils.hx | 2 +- src/checkstyle/utils/ExprUtils.hx | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.haxerc b/.haxerc index 3ee99dd1..22c3a572 100644 --- a/.haxerc +++ b/.haxerc @@ -1,4 +1,4 @@ { - "version": "4.3.3", + "version": "4.3.4", "resolveLibs": "scoped" } \ No newline at end of file diff --git a/src/checkstyle/checks/Check.hx b/src/checkstyle/checks/Check.hx index 2058cec3..9e2b6c99 100644 --- a/src/checkstyle/checks/Check.hx +++ b/src/checkstyle/checks/Check.hx @@ -188,13 +188,13 @@ class Check { case EEnum(d): if ((pos <= td.pos.max) && (pos >= td.pos.min)) return d.flags.contains(EExtern); case ETypedef(d): - if ((pos <= td.pos.max) && (pos >= td.pos.min)) return d.flags.contains(EExtern); + if ((pos <= td.pos.max) && (pos >= td.pos.min)) return d.flags.contains(TDExtern); switch (d.data) { case TAnonymous(fields): for (field in fields) { if (pos > field.pos.max) continue; if (pos < field.pos.min) continue; - return d.flags.contains(EExtern); + return d.flags.contains(TDExtern); } default: } diff --git a/src/checkstyle/checks/naming/ConstantNameCheck.hx b/src/checkstyle/checks/naming/ConstantNameCheck.hx index a2232cbd..33606ed1 100644 --- a/src/checkstyle/checks/naming/ConstantNameCheck.hx +++ b/src/checkstyle/checks/naming/ConstantNameCheck.hx @@ -24,7 +24,7 @@ class ConstantNameCheck extends NameCheckBase { checkFields(d.data, decl.toParentType()); } - override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) {} + override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) {} function checkFields(d:Array, p:ParentType) { for (field in d) { diff --git a/src/checkstyle/checks/naming/MemberNameCheck.hx b/src/checkstyle/checks/naming/MemberNameCheck.hx index 3fe4b0fb..a5c92d87 100644 --- a/src/checkstyle/checks/naming/MemberNameCheck.hx +++ b/src/checkstyle/checks/naming/MemberNameCheck.hx @@ -37,9 +37,9 @@ class MemberNameCheck extends NameCheckBase { checkFields(d.data, decl.toParentType()); } - override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) { + override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) { if (!hasToken(TYPEDEF)) return; - if (ignoreExtern && d.flags.contains(EExtern)) return; + if (ignoreExtern && d.flags.contains(TDExtern)) return; switch (d.data) { case TAnonymous(f): diff --git a/src/checkstyle/checks/naming/MethodNameCheck.hx b/src/checkstyle/checks/naming/MethodNameCheck.hx index b1660e0d..b993e733 100644 --- a/src/checkstyle/checks/naming/MethodNameCheck.hx +++ b/src/checkstyle/checks/naming/MethodNameCheck.hx @@ -21,8 +21,8 @@ class MethodNameCheck extends NameCheckBase { checkFields(d.data, decl.toParentType()); } - override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) { - if (ignoreExtern && d.flags.contains(EExtern)) return; + override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) { + if (ignoreExtern && d.flags.contains(TDExtern)) return; var p = decl.toParentType(); switch (d.data) { diff --git a/src/checkstyle/checks/naming/NameCheckBase.hx b/src/checkstyle/checks/naming/NameCheckBase.hx index c39868e8..2b27f756 100644 --- a/src/checkstyle/checks/naming/NameCheckBase.hx +++ b/src/checkstyle/checks/naming/NameCheckBase.hx @@ -62,7 +62,7 @@ class NameCheckBase extends Check { function checkAbstractType(decl:TypeDef, d:Definition>, pos:Position) {} - function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) {} + function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) {} function matchTypeName(type:String, name:String, pos:Position) { if (!formatRE.match(name)) { diff --git a/src/checkstyle/checks/naming/ParameterNameCheck.hx b/src/checkstyle/checks/naming/ParameterNameCheck.hx index 43851530..0d7bf0f5 100644 --- a/src/checkstyle/checks/naming/ParameterNameCheck.hx +++ b/src/checkstyle/checks/naming/ParameterNameCheck.hx @@ -25,8 +25,8 @@ class ParameterNameCheck extends NameCheckBase { checkFields(d.data); } - override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) { - if (ignoreExtern && d.flags.contains(EExtern)) return; + override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) { + if (ignoreExtern && d.flags.contains(TDExtern)) return; switch (d.data) { case TAnonymous(f): checkFields(f); diff --git a/src/checkstyle/checks/naming/TypeNameCheck.hx b/src/checkstyle/checks/naming/TypeNameCheck.hx index 36726eb6..8e21edfa 100644 --- a/src/checkstyle/checks/naming/TypeNameCheck.hx +++ b/src/checkstyle/checks/naming/TypeNameCheck.hx @@ -38,9 +38,9 @@ class TypeNameCheck extends NameCheckBase { matchTypeName("abstract", d.name, pos); } - override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) { + override function checkTypedefType(decl:TypeDef, d:Definition, pos:Position) { if (!hasToken(TYPEDEF)) return; - if (ignoreExtern && d.flags.contains(EExtern)) return; + if (ignoreExtern && d.flags.contains(TDExtern)) return; matchTypeName("typedef", d.name, pos); } diff --git a/src/checkstyle/utils/ComplexTypeUtils.hx b/src/checkstyle/utils/ComplexTypeUtils.hx index 8e2c3d2c..35b9b87b 100644 --- a/src/checkstyle/utils/ComplexTypeUtils.hx +++ b/src/checkstyle/utils/ComplexTypeUtils.hx @@ -69,7 +69,7 @@ class ComplexTypeUtils { public static function walkImport(sl, mode, cb:ComplexTypeCallback) {} - public static function walkTypedef(d:Definition, pos:Position, cb:ComplexTypeCallback) { + public static function walkTypedef(d:Definition, pos:Position, cb:ComplexTypeCallback) { walkCommonDefinition(d, pos, cb); walkComplexType(d.data, d.name, pos, cb); } diff --git a/src/checkstyle/utils/ExprUtils.hx b/src/checkstyle/utils/ExprUtils.hx index 7798239c..9853bef1 100644 --- a/src/checkstyle/utils/ExprUtils.hx +++ b/src/checkstyle/utils/ExprUtils.hx @@ -69,7 +69,7 @@ class ExprUtils { public static function walkImport(sl, mode, cb:Expr -> Void) {} - public static function walkTypedef(d:Definition, cb:Expr -> Void) { + public static function walkTypedef(d:Definition, cb:Expr -> Void) { walkCommonDefinition(d, cb); walkComplexType(d.data, cb); }