示例#1
0
 internal void TransformList <T>(ref StructList <T> list) where T : AstNode
 {
     for (var i = 0; i < list.Count; i++)
     {
         var originalNode = list[i];
         var item         = Transform(originalNode, true);
         if (item == Remove)
         {
             list.RemoveAt(i);
             Modified = true;
             i--;
         }
         else if (item is AstSpreadStructList <T> spreadList)
         {
             list.ReplaceItemAt(i, spreadList.NodeList);
             Modified = true;
         }
         else
         {
             if (originalNode != item)
             {
                 Modified = true;
             }
             list[i] = (T)item;
         }
     }
 }
示例#2
0
 public SymbolDef(AstScope scope, AstSymbol orig, AstNode?init)
 {
     Name  = orig.Name;
     Scope = scope;
     Orig  = new StructList <AstSymbol>();
     Orig.Add(orig);
     Init        = init;
     References  = new StructList <AstSymbol>();
     Global      = false;
     MangledName = null;
     MangledIdx  = -2;
     Undeclared  = false;
     Defun       = null;
 }
示例#3
0
 protected static AstNode SpreadStructList(ref StructList <AstNode> statements)
 {
     return(new AstSpreadStructList <AstNode>(ref statements));
 }
示例#4
0
 public AstSpreadStructList(ref StructList <T> nodeList)
 {
     NodeList.TransferFrom(ref nodeList);
 }
示例#5
0
 public AstSpreadStructList(ref StructList <T> nodeList)
 {
     NodeList = nodeList;
 }