Skip to content

Commit e3e06e1

Browse files
authored
added support for #if !macro (#316)
* add support for !macro, fixes #315
1 parent 5ca7bd3 commit e3e06e1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/checkstyle/utils/TokenTreeCheckUtils.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class TokenTreeCheckUtils {
6464
return switch (child.tok) {
6565
case Const(_): true;
6666
case POpen: true;
67+
case Kwd(KwdMacro): true;
6768
default: false;
6869
}
6970
}

test/checks/whitespace/OperatorWhitespaceCheckTest.hx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class OperatorWhitespaceCheckTest extends CheckTestCase<OperatorWhitespaceCheckT
3636
assertNoMsg(check, NEGATIVE_NUMS);
3737
assertNoMsg(check, OPGT);
3838
assertNoMsg(check, MACRO_TYPES);
39+
assertNoMsg(check, MACRO_NOT);
3940
}
4041

4142
public function testIncorrectOperatorWhitespaceToken() {
@@ -461,4 +462,13 @@ abstract OperatorWhitespaceCheckTests(String) to String {
461462
return macro $e + $e;
462463
}
463464
}";
465+
466+
var MACRO_NOT = "
467+
#if !macro
468+
@:autoBuild(some.BuildMacro.build())
469+
#end
470+
class Test {
471+
function test() {
472+
}
473+
}";
464474
}

0 commit comments

Comments
 (0)