Example #1
0
 // making sure the for control is in a single line 
 //rather than splitted by semicolons.
 public void forcontrol(List<string> lis){
   Layers lay = new Layers();
   List<string> li = new List<string>();
   string j = null;
   int flag = 0;
   foreach (string line in lis){
     if (line.Contains("for")){
       j += line;
       if (line.Contains(")")){
         li.Add(line);
       } else {
         flag = 1;
       }
     } else if(flag == 1){
       j += line;
       if (line.Contains(")")){
         li.Add(j);
         flag = 0;
       }
     } else if(flag == 0){
       li.Add(line);
     }
   }
   lay.addbrackets(li);
 }