Skip to content

Use common variants for open and close delimiters #18430

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

Merged
merged 3 commits into from
Oct 31, 2014

Conversation

brendanzab
Copy link
Member

This common representation for delimeters should make pattern matching easier. Having a separate token::DelimToken enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in ast::TtDelimited, removing the need to ensure matched delimiters when working with token trees, (for example, in gl-rs)

@brendanzab brendanzab force-pushed the token branch 3 times, most recently from dfbbb23 to 81a0142 Compare October 29, 2014 22:32
This common representation for delimeters should make pattern matching easier. Having a separate `token::DelimToken` enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in `ast::TtDelimited`, removing the need to ensure matched delimiters when working with token trees.
We can simplify these usages due to the new delimiter representation. `Parser::expect_open_delim` has been added for convenience.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Oct 31, 2014
Conflicts:
	src/libsyntax/parse/parser.rs
@bors bors merged commit 98a4770 into rust-lang:master Oct 31, 2014
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.

3 participants