Esempio n. 1
0
        public static JsExpression CreateJsExpression(JsToken lhs, JsBinaryOperator op, JsToken rhs)
        {
            if (op is JsAnd opAnd)
            {
                return(new JsLogicalExpression(lhs, opAnd, rhs));
            }
            if (op is JsOr opOr)
            {
                return(new JsLogicalExpression(lhs, opOr, rhs));
            }

            return(new JsBinaryExpression(lhs, op, rhs));
        }
Esempio n. 2
0
 public JsBinaryExpression(JsToken left, JsBinaryOperator @operator, JsToken right)
 {
     Left     = left ?? throw new SyntaxErrorException($"Left Expression missing in Binary Expression");
     Operator = @operator ?? throw new SyntaxErrorException($"Operator missing in Binary Expression");
     Right    = right ?? throw new SyntaxErrorException($"Right Expression missing in Binary Expression");
 }
 public JsBinaryExpression(JsToken left, JsBinaryOperator operand, JsToken right)
 {
     Left    = left;
     Operand = operand;
     Right   = right;
 }