Inheritance: ScriptExpression
Exemplo n.º 1
0
 object IScriptCustomType.EvaluateUnaryExpression(ScriptUnaryExpression expression)
 {
     throw new ScriptRuntimeException(expression.Span,
                                      $"Operator [{expression.Operator}] is not supported for an array");
 }
Exemplo n.º 2
0
 object IScriptCustomType.EvaluateUnaryExpression(ScriptUnaryExpression expression)
 {
     throw new ScriptRuntimeException(expression.Span, $"Operator [{expression.Operator}] is not supported for date");
 }
Exemplo n.º 3
0
 object IScriptCustomType.EvaluateUnaryExpression(ScriptUnaryExpression expression)
 {
     switch (expression.Operator)
     {
         case ScriptUnaryOperator.Negate:
             return (ScriptTimeSpan)value.Negate();
         case ScriptUnaryOperator.Not:
             return value == TimeSpan.Zero;
         default:
             throw new ScriptRuntimeException(expression.Span, $"Operator [{expression.Operator}] is not supported for timespan");
     }
 }