mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 08:05:45 +00:00
ZoneCodeGenerator: Add helper methods to Operation for the template engine to know whether parenthesis are required or not
This commit is contained in:
parent
8c303d394d
commit
f80d661c1b
@ -9,7 +9,13 @@ namespace ZoneCodeGenerator.Domain.Evaluation
|
||||
class Operation : IEvaluation
|
||||
{
|
||||
public IEvaluation Operand1 { get; }
|
||||
public bool Operand1NeedsParenthesis => Operand1 is Operation operation1 &&
|
||||
operation1.OperationType.Precedence > OperationType.Precedence;
|
||||
|
||||
public IEvaluation Operand2 { get; }
|
||||
public bool Operand2NeedsParenthesis => Operand2 is Operation operation2 &&
|
||||
operation2.OperationType.Precedence > OperationType.Precedence;
|
||||
|
||||
public OperationType OperationType { get; }
|
||||
|
||||
public bool IsStatic => Operand1.IsStatic && Operand2.IsStatic;
|
||||
|
Loading…
x
Reference in New Issue
Block a user