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

Don't treat primitives as a separate syntactic class #4

Open
drtychai opened this issue Nov 17, 2020 · 0 comments
Open

Don't treat primitives as a separate syntactic class #4

drtychai opened this issue Nov 17, 2020 · 0 comments
Assignees

Comments

@drtychai
Copy link
Owner

rust-lang#636

Currently types like i32, f32, and str are a separate syntactic class,
which means that code like struct i32 {} produces confusing errors:

error: parse error: Unrecognized token `i32` found at 7:10
Expected one of r#"([A-Za-z]|_)([A-Za-z0-9]|_)*"#

I can't think of a reason off the top of my head why primitives have to be
special-cased in the parser rather than just being declared in libstd.chalk
(or even the IR or something). If there's a reason, I'm curious to here it!

This is probably low-priority, but it might be nice to change.

See the Zulip discussion.

@drtychai drtychai self-assigned this Nov 17, 2020
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

1 participant