From b0b1b5ae681d7560143ce334e4dff4b78ba51db2 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Wed, 18 Sep 2024 01:25:48 +0200 Subject: [PATCH] fixed parse error when trying to format conditional arrow function --- .github/workflows/formatter.yml | 4 +-- .haxerc | 4 +-- CHANGELOG.md | 3 +++ haxe_libraries/tokentree.hxml | 6 ++--- haxelib.json | 2 +- package-lock.json | 4 +-- package.json | 2 +- .../mark_arrow_npe_with_conditionals.hxtest | 26 +++++++++++++++++++ 8 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 test/testcases/whitespace/mark_arrow_npe_with_conditionals.hxtest diff --git a/.github/workflows/formatter.yml b/.github/workflows/formatter.yml index 3ba512a..633cf59 100644 --- a/.github/workflows/formatter.yml +++ b/.github/workflows/formatter.yml @@ -14,8 +14,8 @@ jobs: build: strategy: matrix: - haxe-version: ['4.3.4', 'nightly'] - platform: [ubuntu-latest, macos-latest, windows-latest] + haxe-version: ['4.3.6', 'nightly'] + platform: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - name: Set Git Auto CRLF to false on Windows diff --git a/.haxerc b/.haxerc index 22c3a57..a9e2278 100644 --- a/.haxerc +++ b/.haxerc @@ -1,4 +1,4 @@ { - "version": "4.3.4", + "version": "4.3.6", "resolveLibs": "scoped" -} \ No newline at end of file +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 45a9319..5b23034 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,11 @@ ## dev branch / next version (1.x.x) +## version 1.16.1 (2024-09-18) + - Refactored unittests to work with utest library ([#679](https://github.com/HaxeCheckstyle/haxe-formatter/issues/679)) - Removed munit library ([#679](https://github.com/HaxeCheckstyle/haxe-formatter/issues/679)) +- Fixed parse error when trying to format conditional arrow function ## version 1.16.0 (2024-02-10) diff --git a/haxe_libraries/tokentree.hxml b/haxe_libraries/tokentree.hxml index 751ca6e..8563615 100644 --- a/haxe_libraries/tokentree.hxml +++ b/haxe_libraries/tokentree.hxml @@ -1,3 +1,3 @@ -# @install: lix --silent download "haxelib:/tokentree#1.2.13" into tokentree/1.2.13/haxelib --cp ${HAXE_LIBCACHE}/tokentree/1.2.13/haxelib/src --D tokentree=1.2.13 \ No newline at end of file +# @install: lix --silent download "haxelib:/tokentree#1.2.14" into tokentree/1.2.14/haxelib +-cp ${HAXE_LIBCACHE}/tokentree/1.2.14/haxelib/src +-D tokentree=1.2.14 \ No newline at end of file diff --git a/haxelib.json b/haxelib.json index 449cf12..181c04c 100644 --- a/haxelib.json +++ b/haxelib.json @@ -8,7 +8,7 @@ "style" ], "description": "A code formatter for Haxe", - "version": "1.16.0", + "version": "1.16.1", "releasenote": "Added wrapping.mapWrap; fixed some indentation issues - see CHANGELOG for details.", "contributors": [ "AlexHaxe", diff --git a/package-lock.json b/package-lock.json index 38ed12e..694acd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@haxecheckstyle/haxe-formatter", - "version": "1.16.0", + "version": "1.16.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@haxecheckstyle/haxe-formatter", - "version": "1.16.0", + "version": "1.16.1", "license": "MIT", "bin": { "haxe-formatter": "bin/formatter.js" diff --git a/package.json b/package.json index 179b51c..62d0e49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@haxecheckstyle/haxe-formatter", - "version": "1.16.0", + "version": "1.16.1", "description": "A code formatter for Haxe", "repository": { "type": "git", diff --git a/test/testcases/whitespace/mark_arrow_npe_with_conditionals.hxtest b/test/testcases/whitespace/mark_arrow_npe_with_conditionals.hxtest new file mode 100644 index 0000000..eb253c1 --- /dev/null +++ b/test/testcases/whitespace/mark_arrow_npe_with_conditionals.hxtest @@ -0,0 +1,26 @@ +{} + +--- + +function prepareToSong() +{ +#if (target.threaded) +Thread.create(() -> { +#end +completedThread(); +#if (target.threaded) +}); +#end +} + +--- + +function prepareToSong() { + #if (target.threaded) + Thread.create(() -> { + #end + completedThread(); + #if (target.threaded) + }); + #end +}