From f742f2cc46f02dbc83bdd24f8eb18030925f8d93 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Wed, 5 Jul 2023 19:40:49 +0200 Subject: [PATCH] updated haxeparser fixed enum abstract handling --- .github/workflows/checkstyle-linux.yml | 2 +- haxe_libraries/haxeparser.hxml | 4 ++-- haxe_libraries/tokentree.hxml | 6 +++--- src/checkstyle/utils/ComplexTypeUtils.hx | 2 +- src/checkstyle/utils/ExprUtils.hx | 2 +- src/checkstyle/utils/FieldUtils.hx | 7 +++++++ 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checkstyle-linux.yml b/.github/workflows/checkstyle-linux.yml index 016db21d..6dd9441a 100644 --- a/.github/workflows/checkstyle-linux.yml +++ b/.github/workflows/checkstyle-linux.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - haxe-version: ['4.3.0', 'nightly'] + haxe-version: ['4.3.1', 'nightly'] env: CC_TEST_REPORTER_ID: c4eda639526d39fbcab7ab9fc68c4046d4e597df56dbcb552b42d27b3580b758 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/haxe_libraries/haxeparser.hxml b/haxe_libraries/haxeparser.hxml index d42c8d51..56ca080e 100644 --- a/haxe_libraries/haxeparser.hxml +++ b/haxe_libraries/haxeparser.hxml @@ -1,4 +1,4 @@ -# @install: lix --silent download "gh://github.com/HaxeCheckstyle/haxeparser#7e98c9aef901b8e26541cf3f8a6e1da0385b237a" into haxeparser/4.3.0-rc.1/github/7e98c9aef901b8e26541cf3f8a6e1da0385b237a +# @install: lix --silent download "gh://github.com/HaxeCheckstyle/haxeparser#5f3d79c4561eea42aae43ee1b3d58e043358c03e" into haxeparser/4.3.0-rc.1/github/5f3d79c4561eea42aae43ee1b3d58e043358c03e -lib hxparse --cp ${HAXE_LIBCACHE}/haxeparser/4.3.0-rc.1/github/7e98c9aef901b8e26541cf3f8a6e1da0385b237a/src +-cp ${HAXE_LIBCACHE}/haxeparser/4.3.0-rc.1/github/5f3d79c4561eea42aae43ee1b3d58e043358c03e/src -D haxeparser=4.3.0-rc.1 \ No newline at end of file diff --git a/haxe_libraries/tokentree.hxml b/haxe_libraries/tokentree.hxml index 32d0a543..33ff084d 100644 --- a/haxe_libraries/tokentree.hxml +++ b/haxe_libraries/tokentree.hxml @@ -1,3 +1,3 @@ -# @install: lix --silent download "haxelib:/tokentree#1.2.9" into tokentree/1.2.9/haxelib --cp ${HAXE_LIBCACHE}/tokentree/1.2.9/haxelib/src --D tokentree=1.2.9 \ No newline at end of file +# @install: lix --silent download "haxelib:/tokentree#1.2.10" into tokentree/1.2.10/haxelib +-cp ${HAXE_LIBCACHE}/tokentree/1.2.10/haxelib/src +-D tokentree=1.2.10 \ No newline at end of file diff --git a/src/checkstyle/utils/ComplexTypeUtils.hx b/src/checkstyle/utils/ComplexTypeUtils.hx index ef0cecfe..8e2c3d2c 100644 --- a/src/checkstyle/utils/ComplexTypeUtils.hx +++ b/src/checkstyle/utils/ComplexTypeUtils.hx @@ -59,7 +59,7 @@ class ComplexTypeUtils { walkCommonDefinition(d, pos, cb); for (f in d.flags) { switch (f) { - case AFromType(ct) | AToType(ct) | AIsType(ct): + case AbFrom(ct) | AbTo(ct) | AbOver(ct): walkComplexType(ct, f.getName(), pos, cb); default: } diff --git a/src/checkstyle/utils/ExprUtils.hx b/src/checkstyle/utils/ExprUtils.hx index 34759196..7798239c 100644 --- a/src/checkstyle/utils/ExprUtils.hx +++ b/src/checkstyle/utils/ExprUtils.hx @@ -59,7 +59,7 @@ class ExprUtils { walkCommonDefinition(d, cb); for (f in d.flags) { switch (f) { - case AFromType(ct) | AToType(ct) | AIsType(ct): + case AbFrom(ct) | AbTo(ct) | AbOver(ct): walkComplexType(ct, cb); default: } diff --git a/src/checkstyle/utils/FieldUtils.hx b/src/checkstyle/utils/FieldUtils.hx index 6fb96487..7de85944 100644 --- a/src/checkstyle/utils/FieldUtils.hx +++ b/src/checkstyle/utils/FieldUtils.hx @@ -56,6 +56,13 @@ class FieldUtils { case EAbstract(a): var metaName = #if (haxeparser > "3.2.0") ":enum" #else ":kwdenum" #end; var kind = a.meta.hasMeta(metaName) ? ENUM_ABSTRACT : ABSTRACT; + for (flag in a.flags) { + switch (flag) { + case AbEnum: + kind = ENUM_ABSTRACT; + default: + } + } return {decl: decl, kind: kind}; case ETypedef(d): return {decl: decl, kind: TYPEDEF};