Remove private tags from Ast

This commit is contained in:
Ayaz Hafiz 2022-04-25 11:20:37 -04:00
parent 67eb4b9faa
commit 1ed9cf551a
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
16 changed files with 12 additions and 196 deletions

View file

@ -468,9 +468,7 @@ impl<'a> Formattable for Tag<'a> {
use self::Tag::*;
match self {
Global { args, .. } | Private { args, .. } => {
args.iter().any(|arg| (&arg.value).is_multiline())
}
Global { args, .. } => args.iter().any(|arg| (&arg.value).is_multiline()),
Tag::SpaceBefore(_, _) | Tag::SpaceAfter(_, _) => true,
Malformed(text) => text.chars().any(|c| c == '\n'),
}
@ -503,24 +501,6 @@ impl<'a> Formattable for Tag<'a> {
}
}
}
Tag::Private { name, args } => {
debug_assert!(name.value.starts_with('@'));
buf.indent(indent);
buf.push_str(name.value);
if is_multiline {
let arg_indent = indent + INDENT;
for arg in *args {
buf.newline();
arg.format_with_options(buf, Parens::InApply, Newlines::No, arg_indent);
}
} else {
for arg in *args {
buf.spaces(1);
arg.format_with_options(buf, Parens::InApply, Newlines::No, indent);
}
}
}
Tag::SpaceBefore(_, _) | Tag::SpaceAfter(_, _) => unreachable!(),
Tag::Malformed(raw) => {
buf.indent(indent);