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

RFC to restrict placing an identifier after a literal. #463

Merged
merged 1 commit into from
Nov 18, 2014

Conversation

huonw
Copy link
Member

@huonw huonw commented Nov 13, 2014

Include identifiers immediately after literals in the literal token to allow future expansion, e.g. "foo"bar and a 1baz are considered whole (but semantically invalid) tokens, rather than two separate tokens "foo", bar and 1, baz respectively. This allows future expansion of handling literals without risking breaking (macro) code.

@huonw
Copy link
Member Author

huonw commented Nov 13, 2014

See #329 for an old, restricted version of this.

- Should it be the parser or the tokenizer rejecting invalid suffixes?
This is effectively asking if it is legal for syntax extensions to
be passed the raw literals? That is, can a `foo` procedural syntax
extension accept and handle literals like `foo!(1u2)`?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parser. We get maximum flexibility that way, for minimum overhead

@nrc
Copy link
Member

nrc commented Nov 17, 2014

+1 seems like a less hacky and more flexible way to implement our literals syntax

@brendanzab
Copy link
Member

+1

@nrc
Copy link
Member

nrc commented Nov 18, 2014

This was discussed at this week's meeting and we will accept, however, we will not block 1.0 on it.

@nrc
Copy link
Member

nrc commented Nov 18, 2014

Tracking issue

@nrc nrc merged commit d8d22fd into rust-lang:master Nov 18, 2014
nrc added a commit that referenced this pull request Nov 18, 2014
@Centril Centril added the A-syntax Syntax related proposals & ideas label Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntax Syntax related proposals & ideas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants