Skip to content

Should 5.f parse as a float literal, or expr_field(int literal, "f")? #1306

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

Closed
marijnh opened this issue Dec 15, 2011 · 2 comments
Closed

Should 5.f parse as a float literal, or expr_field(int literal, "f")? #1306

marijnh opened this issue Dec 15, 2011 · 2 comments

Comments

@marijnh
Copy link
Contributor

marijnh commented Dec 15, 2011

We can make the lexer not consider a dot part of a number when followed immediately by a letter. This makes 5.f, 10.f64, and similar invalid, but the dot is already redundant there anyway.

This allows us to do 10.some_method_name(). That'd be a relatively rare thing to write, but allowing it is nice, and it removes some kludgy code from the pretty-printer.

@ghost ghost assigned marijnh Dec 15, 2011
@nikomatsakis
Copy link
Contributor

+1

@boggle
Copy link
Contributor

boggle commented Dec 15, 2011

I'm for it.

@marijnh marijnh removed their assignment Jun 16, 2014
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
* Edit overview.md

* Fix lexer crate

* Edit wording

Co-authored-by: pierwill <[email protected]>
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
* Edit overview.md

* Fix lexer crate

* Edit wording

Co-authored-by: pierwill <[email protected]>
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