Esempio n. 1
0
 public static string ToInstructionString(this CompareInstructionOperator @operator)
 {
     return(@operator switch
     {
         CompareInstructionOperator.Equal => "EQ",
         CompareInstructionOperator.NotEqual => "NE",
         CompareInstructionOperator.LessThan => "LT",
         CompareInstructionOperator.LessThanOrEqual => "LTE",
         CompareInstructionOperator.GreaterThan => "GT",
         CompareInstructionOperator.GreaterThanOrEqual => "GTE",
         _ => throw ExhaustiveMatch.Failed(@operator)
     });
Esempio n. 2
0
 public CompareInstruction(
     Place resultPlace,
     CompareInstructionOperator @operator,
     NumericType type,
     Operand leftOperand,
     Operand rightOperand,
     Scope scope)
     : base(resultPlace, TextSpan.Covering(leftOperand.Span, rightOperand.Span), scope)
 {
     Operator     = @operator;
     LeftOperand  = leftOperand;
     RightOperand = rightOperand;
     Type         = type;
 }