Esempio n. 1
0
        public override object VisitTupleExpression(TupleExpressionContext context)
        {
            var obj = "";

            foreach (var i in range(0, context.expression().Length - 1, 1, true, true))
            {
                var r = (Result)(Visit(context.expression(i)));
                if (i == 0)
                {
                    obj += r.text;
                }
                else
                {
                    obj += ", " + r.text;
                }
            }
            if (context.expression().Length > 1)
            {
                obj = (new System.Text.StringBuilder().Append("(").Append(obj).Append(")")).to_str();
            }
            return(new Result()
            {
                data = "var", text = obj
            });
        }
Esempio n. 2
0
        public override object VisitTupleExpression(TupleExpressionContext context)
        {
            var obj = "";

            foreach (var(i, v) in context.expression().WithIndex())
            {
                var r = ((Result)Visit(v));
                if (i == 0)
                {
                    obj += r.text;
                }
                else
                {
                    obj += ", " + r.text;
                }
            }
            if (context.expression().Length > 1)
            {
                obj = (new System.Text.StringBuilder().Append("(").Append(obj).Append(")")).To_Str();
            }
            return(new Result("var", obj));
        }
Esempio n. 3
0
        public override object VisitTupleExpression([NotNull] TupleExpressionContext context)
        {
            var obj = "(";

            for (int i = 0; i < context.expression().Length; i++)
            {
                var r = (Result)Visit(context.expression(i));
                if (i == 0)
                {
                    obj += r.text;
                }
                else
                {
                    obj += ", " + r.text;
                }
            }
            obj += ")";
            var result = new Result {
                data = "var", text = obj
            };

            return(result);
        }