Skip to content

Commit

Permalink
fixed TypedefFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Apr 18, 2024
1 parent 3be9b42 commit 35ed8f1
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .haxerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.3.3",
"version": "4.3.4",
"resolveLibs": "scoped"
}
4 changes: 2 additions & 2 deletions src/checkstyle/checks/Check.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
}
Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/checks/naming/ConstantNameCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ConstantNameCheck extends NameCheckBase<ConstantNameCheckToken> {
checkFields(d.data, decl.toParentType());
}

override function checkTypedefType(decl:TypeDef, d:Definition<EnumFlag, ComplexType>, pos:Position) {}
override function checkTypedefType(decl:TypeDef, d:Definition<TypedefFlag, ComplexType>, pos:Position) {}

function checkFields(d:Array<Field>, p:ParentType) {
for (field in d) {
Expand Down
4 changes: 2 additions & 2 deletions src/checkstyle/checks/naming/MemberNameCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class MemberNameCheck extends NameCheckBase<MemberNameCheckToken> {
checkFields(d.data, decl.toParentType());
}

override function checkTypedefType(decl:TypeDef, d:Definition<EnumFlag, ComplexType>, pos:Position) {
override function checkTypedefType(decl:TypeDef, d:Definition<TypedefFlag, ComplexType>, 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):
Expand Down
4 changes: 2 additions & 2 deletions src/checkstyle/checks/naming/MethodNameCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class MethodNameCheck extends NameCheckBase<MethodNameCheckToken> {
checkFields(d.data, decl.toParentType());
}

override function checkTypedefType(decl:TypeDef, d:Definition<EnumFlag, ComplexType>, pos:Position) {
if (ignoreExtern && d.flags.contains(EExtern)) return;
override function checkTypedefType(decl:TypeDef, d:Definition<TypedefFlag, ComplexType>, pos:Position) {
if (ignoreExtern && d.flags.contains(TDExtern)) return;

var p = decl.toParentType();
switch (d.data) {
Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/checks/naming/NameCheckBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class NameCheckBase<T> extends Check {

function checkAbstractType(decl:TypeDef, d:Definition<AbstractFlag, Array<Field>>, pos:Position) {}

function checkTypedefType(decl:TypeDef, d:Definition<EnumFlag, ComplexType>, pos:Position) {}
function checkTypedefType(decl:TypeDef, d:Definition<TypedefFlag, ComplexType>, pos:Position) {}

function matchTypeName(type:String, name:String, pos:Position) {
if (!formatRE.match(name)) {
Expand Down
4 changes: 2 additions & 2 deletions src/checkstyle/checks/naming/ParameterNameCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class ParameterNameCheck extends NameCheckBase<String> {
checkFields(d.data);
}

override function checkTypedefType(decl:TypeDef, d:Definition<EnumFlag, ComplexType>, pos:Position) {
if (ignoreExtern && d.flags.contains(EExtern)) return;
override function checkTypedefType(decl:TypeDef, d:Definition<TypedefFlag, ComplexType>, pos:Position) {
if (ignoreExtern && d.flags.contains(TDExtern)) return;
switch (d.data) {
case TAnonymous(f):
checkFields(f);
Expand Down
4 changes: 2 additions & 2 deletions src/checkstyle/checks/naming/TypeNameCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class TypeNameCheck extends NameCheckBase<TypeNameCheckToken> {
matchTypeName("abstract", d.name, pos);
}

override function checkTypedefType(decl:TypeDef, d:Definition<EnumFlag, ComplexType>, pos:Position) {
override function checkTypedefType(decl:TypeDef, d:Definition<TypedefFlag, ComplexType>, 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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/utils/ComplexTypeUtils.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ComplexTypeUtils {

public static function walkImport(sl, mode, cb:ComplexTypeCallback) {}

public static function walkTypedef(d:Definition<EnumFlag, ComplexType>, pos:Position, cb:ComplexTypeCallback) {
public static function walkTypedef(d:Definition<TypedefFlag, ComplexType>, pos:Position, cb:ComplexTypeCallback) {
walkCommonDefinition(d, pos, cb);
walkComplexType(d.data, d.name, pos, cb);
}
Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/utils/ExprUtils.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ExprUtils {

public static function walkImport(sl, mode, cb:Expr -> Void) {}

public static function walkTypedef(d:Definition<EnumFlag, ComplexType>, cb:Expr -> Void) {
public static function walkTypedef(d:Definition<TypedefFlag, ComplexType>, cb:Expr -> Void) {
walkCommonDefinition(d, cb);
walkComplexType(d.data, cb);
}
Expand Down

0 comments on commit 35ed8f1

Please sign in to comment.