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

Better error messages for \x and \u #8192

Conversation

RealyUniqueName
Copy link
Member

Fixes #8191

X1.hx:2: character 11 : Invalid escape sequence \x. Must be followed by a hexadecimal sequence.
U5.hx:2: character 11 : Invalid escape sequence \u. Maximum allowed value for unicode escape sequence is \u10FFFF

@RealyUniqueName RealyUniqueName added this to the Release 4.0 milestone Apr 19, 2019
@Gama11
Copy link
Member

Gama11 commented Apr 19, 2019

Hm, very minor complaint, but Must be followed by a hexadecimal sequence doesn't seem quite correct for \u, since you also need the {}..

@RealyUniqueName
Copy link
Member Author

Actually \uFFFF also works.
Can somebody propose better wording?

@Gama11
Copy link
Member

Gama11 commented Apr 19, 2019

Oh, I didn't realize that. What's the point of the {} then?

@RealyUniqueName
Copy link
Member Author

According to the ml code, the non-curly version is only allowed for two-byte sequences.

@Gama11
Copy link
Member

Gama11 commented Apr 19, 2019

I see. But yeah, the message is probably fine then, definitely a big improvement to before. :)

@RealyUniqueName
Copy link
Member Author

Changed to

U3.hx:2: character 11 : Invalid escape sequence \u. Must be followed by a hexadecimal sequence enclosed in curly brackets.

because of curly brackets always work.

@RealyUniqueName RealyUniqueName merged commit 032d959 into HaxeFoundation:development Apr 22, 2019
@skial skial mentioned this pull request Apr 22, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid_argument("String.sub / Bytes.sub") with \x
2 participants