forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't make pattern nonterminals match statement nonterminals
- Loading branch information
1 parent
22572d0
commit c61f85b
Showing
5 changed files
with
65 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//@ check-pass | ||
|
||
// Make sure that a `stmt` nonterminal does not eagerly match against | ||
// a `pat`, since this will always cause a parse error... | ||
|
||
macro_rules! m { | ||
($pat:pat) => {}; | ||
($stmt:stmt) => {}; | ||
} | ||
|
||
macro_rules! m2 { | ||
($stmt:stmt) => { | ||
m! { $stmt } | ||
}; | ||
} | ||
|
||
m2! { let x = 1 } | ||
|
||
fn main() {} |