コード例 #1
0
 /// <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));
 }
コード例 #2
0
 internal Step(Span span, ModApply rhs)
     : base(span)
 {
     Contract.Requires(rhs != null);
     Rhs = rhs;
     lhs = new LinkedList <Id>();
     Lhs = new ImmutableCollection <Id>(lhs);
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 internal void AddChoice(ModApply n, bool addLast = true)
 {
     Contract.Requires(n != null);
     if (addLast)
     {
         choices.AddLast(n);
     }
     else
     {
         choices.AddFirst(n);
     }
 }
コード例 #5
0
        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);
        }
コード例 #6
0
 /// <summary>
 /// DO NOT use directly. Only called by parser
 /// </summary>
 /// <param name="modapp"></param>
 internal void SetRhs(ModApply modApp)
 {
     Rhs = modApp;
 }
コード例 #7
0
 private ModApply(ModApply n, bool keepCompilerData)
     : base(n.Span)
 {
     CompilerData = keepCompilerData ? n.CompilerData : null;
 }