Пример #1
0
        public string ToString(ParseContext context)
        {
            var rstring = RValue.ToString(context);
            var lstring = LValue.ToString(context);

            return(lstring + " " + AssignementToString() + " " + rstring);
        }
Пример #2
0
        public string ToString(ParseContext context)
        {
            var result = $"Foreach(var {LoopVarName} in {CollectionSourceVar.ToString(context)})\n";

            result += context.Pad + "{\n";
            context.AddLevel();

            foreach (var line in CodeLines)
            {
                var createVariable = line as CreateVariable;
                createVariable?.DefaultInitialize(context);
                result += context.Pad + line.ToString(context) + ";\n";
            }

            context.RemoveLevel();
            result += context.Pad + "}";
            return(result);
        }