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

New unicode escapes #34

Merged
merged 2 commits into from
Dec 13, 2014
Merged

Conversation

emk
Copy link
Contributor

@emk emk commented Dec 13, 2014

Hello, and thank you for maintaining rust-peg!

Here are two patches to help update rust-peg for the latest version of Rust:

  1. Glob imports now require an explicit allow, and so the first patch updates the generated code accordingly.
  2. The second patch adds support for new-style "\u{...}" escape sequences. The existing "\u" and "\U" escapes are still supported for now, to ease the transition.

Unfortunately, there's one missing piece here: libsyntax's pretty-printer still outputs old-style escape sequences. I'm going to look into that next, and see if it's easy to fix.

@emk
Copy link
Contributor Author

emk commented Dec 13, 2014

OK, I've looked into the libsyntax issue, and filed an appropriate bug: rust-lang/rust#19811.

This rust-peg pull request, however, can be safely merged now, without waiting on an updated libsyntax. Thank you once again for rust-peg!

emk added 2 commits December 13, 2014 14:25
Glob imports require the user to use #[features(globs)], so let's not
generate them if we don't need to.
Note that this only handles the input side, not the output side.  Fixing
the output side will require changes to libsyntax.  Support for old
style \u and \U escapes has been left in for now to ease the transition.
@emk emk force-pushed the new_unicode_escapes branch from a2e9c1f to 02b609f Compare December 13, 2014 19:27
@emk
Copy link
Contributor Author

emk commented Dec 13, 2014

Thank you for the quick review! I've made the changes you suggested.

kevinmehall added a commit that referenced this pull request Dec 13, 2014
@kevinmehall kevinmehall merged commit dc98a03 into kevinmehall:master Dec 13, 2014
@kevinmehall
Copy link
Owner

Thanks!

@emk emk deleted the new_unicode_escapes branch December 13, 2014 21:15
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.

2 participants