コード例 #1
0
ファイル: VifObjectBuilder.cs プロジェクト: 1pindsvin/yagni
 private static VifObject DoBuild(IEnumerable<string> lines)
 {
     var current = new VifObject {IsRoot = true};
     foreach (var line in lines)
     {
         if (ObjectInlineRegex.IsMatch(line))
         {
             var vif = new VifObject();
             vif.AddBeginObjectLine(line);
             vif.Parent = current;
             current = vif;
             continue;
         }
         if (EndOfObjectRegex.IsMatch(line))
         {
             current.AddEndOfObjectLine(line);
             current = current.Parent;
             continue;
         }
         current.AddLine(line);
     }
     return current;
 }