diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-10-14 19:25:40 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-14 21:05:39 +0200 |
commit | b1b202124c943b4eb1480f92b6c72b29a0c91a4d (patch) | |
tree | 77602aa21fb7617df17e1a929cadba9365ec5d68 /Shell | |
parent | 738f512919284c04383fc261927b624d1df45382 (diff) | |
download | serenity-b1b202124c943b4eb1480f92b6c72b29a0c91a4d.zip |
Shell: Use Node::kind() instead of Node::class_name() in formatter
Diffstat (limited to 'Shell')
-rw-r--r-- | Shell/Formatter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Shell/Formatter.cpp b/Shell/Formatter.cpp index 314dbbb85e..4d5b732e1d 100644 --- a/Shell/Formatter.cpp +++ b/Shell/Formatter.cpp @@ -140,7 +140,7 @@ void Formatter::visit(const AST::And* node) { will_visit(node); test_and_update_output_cursor(node); - auto should_indent = m_parent_node && m_parent_node->class_name() != "And"; + auto should_indent = m_parent_node && m_parent_node->kind() != AST::Node::Kind::And; TemporaryChange<const AST::Node*> parent { m_parent_node, node }; with_added_indent(should_indent ? 1 : 0, [&] { @@ -370,7 +370,7 @@ void Formatter::visit(const AST::IfCond* node) if (node->false_branch()) { current_builder().append(" else "); - if (node->false_branch()->class_name() != "IfCond") { + if (node->false_branch()->kind() != AST::Node::Kind::IfCond) { in_new_block([&] { node->false_branch()->visit(*this); }); @@ -446,7 +446,7 @@ void Formatter::visit(const AST::Or* node) { will_visit(node); test_and_update_output_cursor(node); - auto should_indent = m_parent_node && m_parent_node->class_name() != "Or"; + auto should_indent = m_parent_node && m_parent_node->kind() != AST::Node::Kind::Or; TemporaryChange<const AST::Node*> parent { m_parent_node, node }; with_added_indent(should_indent ? 1 : 0, [&] { @@ -465,7 +465,7 @@ void Formatter::visit(const AST::Pipe* node) { will_visit(node); test_and_update_output_cursor(node); - auto should_indent = m_parent_node && m_parent_node->class_name() != "Pipe"; + auto should_indent = m_parent_node && m_parent_node->kind() != AST::Node::Kind::Pipe; TemporaryChange<const AST::Node*> parent { m_parent_node, node }; node->left()->visit(*this); |