Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression starting with a unary minus #547

Closed
Gama11 opened this issue Dec 20, 2019 · 0 comments
Closed

Expression starting with a unary minus #547

Gama11 opened this issue Dec 20, 2019 · 0 comments
Labels
bug Something isn't working lineends line end handling tokentree requires fix in tokentree whitespace missing or incorrect space around token

Comments

@Gama11
Copy link
Member

Gama11 commented Dec 20, 2019

In a utest "spec" test (bool binops are auto-converted to Assert.equals()) you might have something like this:

class Main {
	static function main() {
		a == b;
		-1 != 0;
	}
}

The formatter incorrectly adds whitespace after the - here:

class Main {
	static function main() {
		a == b;
		- 1 != 0;
	}
}

That's not that bad, but after a certain point this also breaks line end handling:

class Main {
	static function main() {a == b;
		- 1 != fairlyLongExpressionHereLoremIpsumFooBar;
		- 1 != fairlyLongExpressionHereLoremIpsumFooBar;
		- 1 != fairlyLongExpressionHereLoremIpsumFooBar;
	}
}
@Gama11 Gama11 added bug Something isn't working whitespace missing or incorrect space around token lineends line end handling labels Dec 20, 2019
@AlexHaxe AlexHaxe added the tokentree requires fix in tokentree label Dec 20, 2019
AlexHaxe added a commit to AlexHaxe/haxe-formatter that referenced this issue Dec 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lineends line end handling tokentree requires fix in tokentree whitespace missing or incorrect space around token
Projects
None yet
Development

No branches or pull requests

2 participants