/// <summary> /// DO NOT use directly: Only called by parser. /// </summary> internal Step(Span span) : base(span) { lhs = new LinkedList <Id>(); Lhs = new ImmutableCollection <Id>(lhs); Rhs = new ModApply(span, new ModRef(span, "?", null, null)); }
internal Step(Span span, ModApply rhs) : base(span) { Contract.Requires(rhs != null); Rhs = rhs; lhs = new LinkedList <Id>(); Lhs = new ImmutableCollection <Id>(lhs); }
internal override Node ShallowClone(Node replace, int pos) { var cnode = new ModApply(this, true); int occurs = 0; cnode.Module = CloneField <ModRef>(Module, replace, pos, ref occurs); cnode.Args = new ImmutableCollection <Node>(CloneCollection <Node>(args, replace, pos, ref occurs, out cnode.args)); return(cnode); }
internal void AddChoice(ModApply n, bool addLast = true) { Contract.Requires(n != null); if (addLast) { choices.AddLast(n); } else { choices.AddFirst(n); } }
internal override Node DeepClone(IEnumerable <Node> clonedChildren, bool keepCompilerData) { var cnode = new ModApply(this, keepCompilerData); cnode.cachedHashCode = this.cachedHashCode; using (var cenum = clonedChildren.GetEnumerator()) { cnode.Module = TakeClone <ModRef>(cenum); cnode.Args = new ImmutableCollection <Node>(TakeClones <Node>(args.Count, cenum, out cnode.args)); } return(cnode); }
/// <summary> /// DO NOT use directly. Only called by parser /// </summary> /// <param name="modapp"></param> internal void SetRhs(ModApply modApp) { Rhs = modApp; }
private ModApply(ModApply n, bool keepCompilerData) : base(n.Span) { CompilerData = keepCompilerData ? n.CompilerData : null; }