mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibJS: Include the operator in BinaryExpression dumps
This commit is contained in:
parent
1611071ac7
commit
0c7058aaa0
Notes:
sideshowbarker
2024-07-19 08:51:02 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0c7058aaa0a
1 changed files with 14 additions and 1 deletions
|
@ -111,8 +111,21 @@ void ScopeNode::dump(int indent) const
|
|||
|
||||
void BinaryExpression::dump(int indent) const
|
||||
{
|
||||
ASTNode::dump(indent);
|
||||
const char* op_string = nullptr;
|
||||
switch (m_op) {
|
||||
case BinaryOp::Plus:
|
||||
op_string = "+";
|
||||
break;
|
||||
case BinaryOp::Minus:
|
||||
op_string = "-";
|
||||
break;
|
||||
}
|
||||
|
||||
print_indent(indent);
|
||||
printf("%s\n", class_name());
|
||||
m_lhs->dump(indent + 1);
|
||||
print_indent(indent + 1);
|
||||
printf("%s\n", op_string);
|
||||
m_rhs->dump(indent + 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue