mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
LibJS: Include the operator in BinaryExpression dumps
This commit is contained in:
parent
1611071ac7
commit
0c7058aaa0
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…
Add table
Add a link
Reference in a new issue