Example #1
0
        public override object VisitSliceEnd([NotNull] SliceEndContext context)
        {
            var order  = "";
            var attach = "false";

            switch (context.op.Text)
            {
            case "<=":
                order  = "true";
                attach = "true";
                break;

            case "<":
                order = "true";
                break;

            case ">=":
                order  = "false";
                attach = "true";
                break;

            case ">":
                order = "false";
                break;

            default:
                break;
            }
            var expr = (Result)Visit(context.expression());

            return($".slice(null, {expr.text}, {order}, {attach})");
        }
Example #2
0
        public override object VisitSliceEnd(SliceEndContext context)
        {
            var order = "true";

            if (context.Dot_Dot() == null)
            {
                order = "false";
            }
            var expr = (Result)(Visit(context.expression()));

            return((new System.Text.StringBuilder().Append(".slice(null, ").Append(expr.text).Append(", ").Append(order).Append(")")).to_str());
        }