Пример #1
0
 public override MultilineStatement Interprete(string src)
 {
     var returns = new ForStmt();
     string temp = "";
     for (int index = 0;
         index < src.Split(new[] { '\n', ';' }, StringSplitOptions.RemoveEmptyEntries).Length;
         index++)
     {
         string i = src.Split(new[] { '\n', ';' }, StringSplitOptions.RemoveEmptyEntries)[index];
         if (index == 0)
         {
             returns.Header = i;
         }
         else if (index > 0
                  && index < src.Split(new[] { '\n', ';' }, StringSplitOptions.RemoveEmptyEntries).Length - 1)
         {
             temp += i + ";\n";
             ;
         }
     }
     returns.Statements = Parser.ParseCodeBlock(temp, "").Nodes;
     return returns;
 }
Пример #2
0
        public override MultilineStatement Interprete(string src)
        {
            var    returns = new ForStmt();
            string temp    = "";

            for (int index = 0;
                 index < src.Split(new[] { '\n', ';' }, StringSplitOptions.RemoveEmptyEntries).Length;
                 index++)
            {
                string i = src.Split(new[] { '\n', ';' }, StringSplitOptions.RemoveEmptyEntries)[index];
                if (index == 0)
                {
                    returns.Header = i;
                }
                else if (index > 0 &&
                         index < src.Split(new[] { '\n', ';' }, StringSplitOptions.RemoveEmptyEntries).Length - 1)
                {
                    temp += i + ";\n";
                    ;
                }
            }
            returns.Statements = Parser.ParseCodeBlock(temp, "").Nodes;
            return(returns);
        }