From 4bb8d958bcf75a254bf9ab5f6ab600aa1b118c95 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Wed, 22 Feb 2023 15:00:09 +0100 Subject: [PATCH] fixed inline call() and inline new issue (#667) --- CHANGELOG.md | 4 ++ README.md | 3 +- haxe_libraries/tokentree.hxml | 6 +- haxelib.json | 4 +- package-lock.json | 4 +- package.json | 2 +- test/testcases/whitespace/inline_calls.hxtest | 59 +++++++++++++++++++ 7 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 test/testcases/whitespace/inline_calls.hxtest diff --git a/CHANGELOG.md b/CHANGELOG.md index e01b966..a590444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## dev branch / next version (1.x.x) +## version 1.14.6 (2023-02-22) + +- Fixed inline call() and inline new issue ([#667](https://github.com/HaxeCheckstyle/haxe-formatter/issues/667)) + ## version 1.14.5 (2023-02-15) - Fixed null pointer issues ([#666](https://github.com/HaxeCheckstyle/haxe-formatter/issues/666)) diff --git a/README.md b/README.md index 19ae2cf..a411c5d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # Haxe Formatter [![Haxelib Version](https://img.shields.io/github/tag/HaxeCheckstyle/haxe-formatter.svg?label=haxelib)](http://lib.haxe.org/p/formatter) -[![Build Status](https://travis-ci.org/HaxeCheckstyle/haxe-formatter.svg?branch=master)](https://travis-ci.org/HaxeCheckstyle/haxe-formatter) +[![Build Status](https://img.shields.io/github/actions/workflow/status/HaxeCheckstyle/haxe-formatter/formatter.yml)](https://github.com/HaxeCheckstyle/haxe-formatter/actions) [![Haxe-Formatter](https://github.com/HaxeCheckstyle/haxe-formatter/workflows/Haxe-Formatter/badge.svg)](https://github.com/HaxeCheckstyle/haxe-formatter/actions) [![codecov](https://codecov.io/gh/HaxeCheckstyle/haxe-formatter/branch/master/graph/badge.svg)](https://codecov.io/gh/HaxeCheckstyle/haxe-formatter) -[![Gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/HaxeCheckstyle/haxe-formatter) A Haxe Code Formatter based on the [tokentree](https://github.com/HaxeCheckstyle/tokentree) library. diff --git a/haxe_libraries/tokentree.hxml b/haxe_libraries/tokentree.hxml index c0e9ddf..97de6e1 100644 --- a/haxe_libraries/tokentree.hxml +++ b/haxe_libraries/tokentree.hxml @@ -1,3 +1,3 @@ -# @install: lix --silent download "haxelib:/tokentree#1.2.7" into tokentree/1.2.7/haxelib --cp ${HAXE_LIBCACHE}/tokentree/1.2.7/haxelib/src --D tokentree=1.2.7 \ No newline at end of file +# @install: lix --silent download "haxelib:/tokentree#1.2.8" into tokentree/1.2.8/haxelib +-cp ${HAXE_LIBCACHE}/tokentree/1.2.8/haxelib/src +-D tokentree=1.2.8 \ No newline at end of file diff --git a/haxelib.json b/haxelib.json index c9ffe87..8e3a429 100644 --- a/haxelib.json +++ b/haxelib.json @@ -8,8 +8,8 @@ "style" ], "description": "A code formatter for Haxe", - "version": "1.14.5", - "releasenote": "fixed null pointer issue - see CHANGELOG for details.", + "version": "1.14.6", + "releasenote": "fixed inline call() and inline new issue - see CHANGELOG for details.", "contributors": [ "AlexHaxe", "Gama11" diff --git a/package-lock.json b/package-lock.json index 1e5ae6d..00f0106 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@haxecheckstyle/haxe-formatter", - "version": "1.14.5", + "version": "1.14.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@haxecheckstyle/haxe-formatter", - "version": "1.14.5", + "version": "1.14.6", "license": "MIT", "bin": { "haxe-formatter": "bin/formatter.js" diff --git a/package.json b/package.json index 8ec8725..26e6741 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@haxecheckstyle/haxe-formatter", - "version": "1.14.5", + "version": "1.14.6", "description": "A code formatter for Haxe", "repository": { "type": "git", diff --git a/test/testcases/whitespace/inline_calls.hxtest b/test/testcases/whitespace/inline_calls.hxtest new file mode 100644 index 0000000..fa64aca --- /dev/null +++ b/test/testcases/whitespace/inline_calls.hxtest @@ -0,0 +1,59 @@ +{} + +--- + +function test(){ + var x = inline toString(); + var x = inline new String(""); + + inline toString(); + inline new String(""); + + inline function testInline(i:Int) { + return i + 1; + } + var testInline = inline function (i:Int) { + return i + 1; + } + use(inline testInline(3)); + inline testInline(3); +} + +class Test { + inline public function new(x:Int, y:Int) {} + public inline function new(x:Int, y:Int) {} + public inline static function new(x:Int, y:Int) {} +} + +inline public function toString(x:Int, y:Int) {} +public inline function toString(x:Int, y:Int) {} + +--- + +function test() { + var x = inline toString(); + var x = inline new String(""); + + inline toString(); + inline new String(""); + + inline function testInline(i:Int) { + return i + 1; + } + var testInline = inline function(i:Int) { + return i + 1; + } + use(inline testInline(3)); + inline testInline(3); +} + +class Test { + inline public function new(x:Int, y:Int) {} + + public inline function new(x:Int, y:Int) {} + + public inline static function new(x:Int, y:Int) {} +} + +inline public function toString(x:Int, y:Int) {} +public inline function toString(x:Int, y:Int) {}