Example #1
0
        public override object VisitCallPkg([NotNull] CallPkgContext context)
        {
            var r = new Result {
                data = Visit(context.type())
            };
            var param = "";

            if (context.expressionList() != null)
            {
                param = ((Result)Visit(context.expressionList())).text;
            }
            r.text = $"(new {Visit(context.type())}({param})";
            if (context.pkgAssign() != null)
            {
                r.text += Visit(context.pkgAssign());
            }
            if (context.listAssign() != null)
            {
                r.text += Visit(context.listAssign());
            }
            if (context.dictionaryAssign() != null)
            {
                r.text += Visit(context.dictionaryAssign());
            }
            r.text += ")";
            return(r);
        }
Example #2
0
        public override object VisitCallPkg(CallPkgContext context)
        {
            var ty = "";
            var r  = (new Result("object"));

            if (context.typeNotNull() != null)
            {
                ty     = ((string)Visit(context.typeNotNull()));
                r.data = ty;
            }
            r.text  = (new System.Text.StringBuilder().Append("(new ").Append(ty)).To_Str();
            r.text += ((Result)Visit(context.tuple())).text;
            r.text += ")";
            return(r);
        }
Example #3
0
        public override object VisitCallPkg(CallPkgContext context)
        {
            var r = (new Result()
            {
                data = Visit(context.typeType())
            });

            r.text = (new System.Text.StringBuilder().Append("(new ").Append(Visit(context.typeType())).Append("()")).to_str();
            if (context.pkgAssign() != null)
            {
                r.text += Visit(context.pkgAssign());
            }
            else if (context.listAssign() != null)
            {
                r.text += Visit(context.listAssign());
            }
            else if (context.dictionaryAssign() != null)
            {
                r.text += Visit(context.dictionaryAssign());
            }
            r.text += ")";
            return(r);
        }