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