Exemplo n.º 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;
         }
     }
 }
Exemplo n.º 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;
 }
Exemplo n.º 3
0
 protected static AstNode SpreadStructList(ref StructList <AstNode> statements)
 {
     return(new AstSpreadStructList <AstNode>(ref statements));
 }
Exemplo n.º 4
0
 public AstSpreadStructList(ref StructList <T> nodeList)
 {
     NodeList.TransferFrom(ref nodeList);
 }
Exemplo n.º 5
0
 public AstSpreadStructList(ref StructList <T> nodeList)
 {
     NodeList = nodeList;
 }