From e1d297747ef961db470b9841e5890e8eb9a6f801 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Thu, 30 May 2019 20:40:36 +0200 Subject: [PATCH] fixed conditionals using dot ident without parens, fixes #480 (#481) * fixed conditionals using dot ident without parens, fixes #480 --- .travis.yml | 4 +-- CHANGELOG.md | 1 + ...ssue_480_conditional_with_dot_ident.hxtest | 31 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 test/testcases/other/issue_480_conditional_with_dot_ident.hxtest diff --git a/.travis.yml b/.travis.yml index 02521880..7a3e87e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ install: - haxelib git tokentree https://github.com/HaxeCheckstyle/tokentree --never - haxelib git hxargs https://github.com/Simn/hxargs --never - haxelib git hxnodejs https://github.com/HaxeFoundation/hxnodejs --never - - haxelib git mcover https://github.com/AlexHaxe/mcover haxe_4_thread src - - haxelib git munit https://github.com/AlexHaxe/MassiveUnit haxe_4_thread src + - haxelib git mcover https://github.com/massiveinteractive/mcover master src + - haxelib git munit https://github.com/massiveinteractive/MassiveUnit master src - haxelib git json2object https://github.com/elnabo/json2object - haxelib install hxjava - haxelib install mlib diff --git a/CHANGELOG.md b/CHANGELOG.md index 55f49cf1..3b325863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed indentation of nested object literals ([#479](https://github.com/HaxeCheckstyle/haxe-formatter/issues/479)) - Fixed array wrapping in call parameters, fixes [#466](https://github.com/HaxeCheckstyle/haxe-formatter/issues/466) ([#479](https://github.com/HaxeCheckstyle/haxe-formatter/issues/479)) +- Fixed conditional using dot ident without parens, fixes [#480](https://github.com/HaxeCheckstyle/haxe-formatter/issues/480) ([#481](https://github.com/HaxeCheckstyle/haxe-formatter/issues/481)) ## version 1.7.0 (2019-05-17) diff --git a/test/testcases/other/issue_480_conditional_with_dot_ident.hxtest b/test/testcases/other/issue_480_conditional_with_dot_ident.hxtest new file mode 100644 index 00000000..550253b9 --- /dev/null +++ b/test/testcases/other/issue_480_conditional_with_dot_ident.hxtest @@ -0,0 +1,31 @@ +{} + +--- + +class Main { + static function main() { + #if target.sys + trace("Test"); + #end + #if marco.sys + trace("Test"); + #end + + return foo #if target .sys #end; + } +} + +--- + +class Main { + static function main() { + #if target.sys + trace("Test"); + #end + #if marco.sys + trace("Test"); + #end + + return foo #if target .sys #end; + } +}