示例#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;
 }