-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for issue 4603 about extra macro body indentation (third version)
- Loading branch information
1 parent
7de6968
commit a3c6e73
Showing
4 changed files
with
120 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Formatting when original macro snippet is used | ||
|
||
// Original issue #4603 code | ||
#![feature(or_patterns)] | ||
macro_rules! t_or_f { | ||
() => { | ||
(true // some comment | ||
| false) | ||
}; | ||
} | ||
|
||
// Other test cases variations | ||
macro_rules! RULES { | ||
() => { | ||
( | ||
xxxxxxx // COMMENT | ||
| yyyyyyy | ||
) | ||
}; | ||
} | ||
macro_rules! RULES { | ||
() => { | ||
(xxxxxxx // COMMENT | ||
| yyyyyyy) | ||
}; | ||
} | ||
|
||
fn main() { | ||
macro_rules! RULES { | ||
() => { | ||
(xxxxxxx // COMMENT | ||
| yyyyyyy) | ||
}; | ||
} | ||
} | ||
|
||
macro_rules! RULES { | ||
() => { | ||
(xxxxxxx /* COMMENT */ | yyyyyyy) | ||
}; | ||
} | ||
macro_rules! RULES { | ||
() => { | ||
(xxxxxxx /* COMMENT */ | ||
| yyyyyyy) | ||
}; | ||
} |
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,47 @@ | ||
// Formatting when original macro snippet is used | ||
|
||
// Original issue #4603 code | ||
#![feature(or_patterns)] | ||
macro_rules! t_or_f { | ||
() => { | ||
(true // some comment | ||
| false) | ||
}; | ||
} | ||
|
||
// Other test cases variations | ||
macro_rules! RULES { | ||
() => { | ||
( | ||
xxxxxxx // COMMENT | ||
| yyyyyyy | ||
) | ||
}; | ||
} | ||
macro_rules! RULES { | ||
() => { | ||
(xxxxxxx // COMMENT | ||
| yyyyyyy) | ||
}; | ||
} | ||
|
||
fn main() { | ||
macro_rules! RULES { | ||
() => { | ||
(xxxxxxx // COMMENT | ||
| yyyyyyy) | ||
}; | ||
} | ||
} | ||
|
||
macro_rules! RULES { | ||
() => { | ||
(xxxxxxx /* COMMENT */ | yyyyyyy) | ||
}; | ||
} | ||
macro_rules! RULES { | ||
() => { | ||
(xxxxxxx /* COMMENT */ | ||
| yyyyyyy) | ||
}; | ||
} |