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

Conditionalized chained function call #375

Closed
Gama11 opened this issue Feb 21, 2019 · 0 comments
Closed

Conditionalized chained function call #375

Gama11 opened this issue Feb 21, 2019 · 0 comments
Labels
bug Something isn't working wrapping Incorrect or undesirable wrapping
Milestone

Comments

@Gama11
Copy link
Member

Gama11 commented Feb 21, 2019

Describe the bug

From the infamous haxe.macro.Printer:

Input file

class Main {
	static function main() {
		return s.replace("\n", "\\n").replace("\t", "\\t").replace("\r", "\\r").replace("'", "\\'").replace('"', "\\\"") #if sys .replace("\x00", "\\x00") #end + delim;
	}
}

Broken output

class Main {
	static function main() {
		return s.replace("\n", "\\n").replace("\t", "\\t").replace("\r", "\\r").replace("'", "\\'").replace('"', "\\\"") #if sys
		.replace("\x00", "\\x00") #end + delim;
	}
}

Not sure what exactly the expected result here is, maybe something like this (conditional start and end kept in same line, and properly indented)?

class Main {
	static function main() {
		return s.replace("\n", "\\n").replace("\t", "\\t").replace("\r", "\\r").replace("'", "\\'").replace('"', "\\\"")
			#if sys .replace("\x00", "\\x00") #end + delim;
	}
}
@Gama11 Gama11 added bug Something isn't working wrapping Incorrect or undesirable wrapping labels Feb 21, 2019
@Gama11 Gama11 added this to the haxe milestone Feb 21, 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 wrapping Incorrect or undesirable wrapping
Projects
None yet
Development

No branches or pull requests

1 participant