mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
Remove private tags from Ast
This commit is contained in:
parent
67eb4b9faa
commit
1ed9cf551a
16 changed files with 12 additions and 196 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue