Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Proper handling of ; between statements. #55

Open
ehuss opened this issue Jun 28, 2019 · 2 comments
Open

Proper handling of ; between statements. #55

ehuss opened this issue Jun 28, 2019 · 2 comments
Labels
grammar Issues with the definition of the rust grammar restrictions Issues related to the permissiveness of the grammar

Comments

@ehuss
Copy link
Contributor

ehuss commented Jun 28, 2019

For example, it currently allows multiple expressions without ; separators which is not correct. It will need to handle the difference of expressions with/without blocks needing ;, etc.

Also consider if Stmt should include macro invocation. Currently it is inherited via expression. Why does rustc parse statement macros separately from expressions (parse_stmt_without_recovery)?

@ehuss ehuss added the grammar Issues with the definition of the rust grammar label Jun 28, 2019
@petrochenkov
Copy link

This is an open question, especially when macros are involved.
I'll try to finish rust-lang/rust#61733 and come up with some consistent/improved rules.

@petrochenkov
Copy link

Tentatively, ; should be a part of the statement syntax and free ;s should be (empty) statements as well.

@eddyb eddyb added restrictions Issues related to the permissiveness of the grammar and removed restrictions Issues related to the permissiveness of the grammar labels Jul 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Issues with the definition of the rust grammar restrictions Issues related to the permissiveness of the grammar
Projects
None yet
Development

No branches or pull requests

3 participants