Preserve alignment boundaries when matching hash-brace macros
This commit is contained in:
1 parent
307303d596
commit
862801ee5f
5 files changed
+57
No files matched your search
@@ -94,6 +94,13 @@ impl Executor {
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
pub(super) fn consume_macro_delimiter(&mut self, kind: &TokenKind) {
|
||||
// The final literal brace of a hash-brace delimiter is appended to the
|
||||
// replacement. Count it when that replacement reaches the alignment.
|
||||
if kind.begin_group() && !self.alignments.is_empty() {
|
||||
self.alignment_balance -= 1;
|
||||
}
|
||||
}
|
||||
pub(super) fn alignment_brace(&mut self, token: &Token) -> i64 {
|
||||
match self.meaning(token) {
|
||||
Meaning::Character(TokenKind::Character(_, CatCode::BeginGroup)) => 1,
|
||||
|
||||
Reference in new issue
Block a user