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

Incorrectly highlighting 'isize' and 'usize' suffix in Rust. #2766

Closed
Grazfather opened this issue Nov 13, 2015 · 10 comments
Closed

Incorrectly highlighting 'isize' and 'usize' suffix in Rust. #2766

Grazfather opened this issue Nov 13, 2015 · 10 comments

Comments

@Grazfather
Copy link

I reported it where I found it in rust-lang/rust-by-example#662

@mdinger Thinks it can be fixed here:
https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/rust_highlight_rules.js#L129-L134

Here is where they changed it in rust: rust-lang/rust#22496

@mdinger
Copy link
Contributor

mdinger commented Nov 13, 2015

To be precise, is and us are no longer valid suffixes on rust numbers. The new suffixes are isize and usize.

@nightwing
Copy link
Member

e8423ae should fix this issue

@mdinger
Copy link
Contributor

mdinger commented Nov 13, 2015

That looks so much better. That one regex was so messy before.

@Grazfather
Copy link
Author

It does look better, and appears to work for me, but it looks like it breaks float suffixes.
image

@Grazfather
Copy link
Author

This is what it looks like on master.
screen shot 2015-11-13 at 2 43 51 pm

@mdinger
Copy link
Contributor

mdinger commented Nov 13, 2015

Maybe:

- /(?:[0-9][0-9_]*\.)(?:[0-9][0-9_]*)(?:[Ee][+-][0-9][0-9_]*)?(?:f32|f64)?\b/
+ /(?:[0-9][0-9_]*)(?:\.[0-9][0-9_]*)(?:[Ee][+-][0-9][0-9_]*)?(?:f32|f64)?\b/

@nightwing
Copy link
Member

Added that and also added ? for (?:\.[0-9][0-9_]*), to highlight numbers like 1e+5
https://github.com/ajaxorg/ace/pull/2770/files#diff-6e75d9c1f4e549bcdc128975b582889cR132

@mdinger
Copy link
Contributor

mdinger commented Nov 14, 2015

Yeah, I meant to put that in but forgot.

@nightwing
Copy link
Member

Ok, considering that as a review +1 for #2770
Thanks.

@Grazfather
Copy link
Author

Quick work. Thanks a lot.

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

No branches or pull requests

3 participants