1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-01 06:22:01 +00:00
Ryujinx/Ryujinx.HLE/HOS/Diagnostics/Demangler/Ast/BracedExpression.cs
2018-12-01 14:03:56 -06:00

40 lines
1.1 KiB
C#

using System.IO;
namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
{
public class BracedExpression : BaseNode
{
private BaseNode _element;
private BaseNode _expression;
private bool _isArrayExpression;
public BracedExpression(BaseNode element, BaseNode expression, bool isArrayExpression) : base(NodeType.BracedExpression)
{
this._element = element;
this._expression = expression;
this._isArrayExpression = isArrayExpression;
}
public override void PrintLeft(TextWriter writer)
{
if (_isArrayExpression)
{
writer.Write("[");
_element.Print(writer);
writer.Write("]");
}
else
{
writer.Write(".");
_element.Print(writer);
}
if (!_expression.GetType().Equals(NodeType.BracedExpression) || !_expression.GetType().Equals(NodeType.BracedRangeExpression))
{
writer.Write(" = ");
}
_expression.Print(writer);
}
}
}