コード例 #1
0
        public StackTransition(IEnumerable <TypeOnStack> popped, IEnumerable <TypeOnStack> pushed, VerificationCallback before = null)
        {
            PoppedFromStack = LinqEnumerable <TypeOnStack> .For(popped).ToArray();

            PushedToStack = LinqEnumerable <TypeOnStack> .For(pushed).ToArray();

            Before = before;
        }
コード例 #2
0
        public static LinqRoot <T> Distinct <T>(IEnumerable <T> e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            return(LinqEnumerable <T> .For(_Distinct(e, EqualityComparer <T> .Default)));
        }
コード例 #3
0
        public static LinqRoot <T> Cast <T>(IEnumerable e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            return(LinqEnumerable <T> .For(_Cast <T>(e)));
        }
コード例 #4
0
 public StackTransition(IEnumerable <Type> popped, IEnumerable <Type> pushed, VerificationCallback before = null)
     : this
     (
         LinqEnumerable <Type> .For(popped).Select(s => TypeOnStack.Get(s)).AsEnumerable(),
         LinqEnumerable <Type> .For(pushed).Select(s => TypeOnStack.Get(s)).AsEnumerable(),
         before
     )
 {
 }
コード例 #5
0
        public static LinqRoot <T> OrderByDescending <T, V>(IEnumerable <T> e, SigilFunc <T, V> p)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }
            if (p == null)
            {
                throw new ArgumentNullException("p");
            }

            return(LinqEnumerable <T> .For(_Order(e, p, DescendingComparer <V> .Default)));
        }
コード例 #6
0
        public static LinqRoot <T> Where <T>(IEnumerable <T> e, SigilFunc <T, bool> p)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }
            if (p == null)
            {
                throw new ArgumentNullException("p");
            }

            return(LinqEnumerable <T> .For(_Where(e, p)));
        }
コード例 #7
0
        public static LinqRoot <V> SelectMany <T, V>(IEnumerable <T> e, SigilFunc <T, IEnumerable <V> > p)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }
            if (p == null)
            {
                throw new ArgumentNullException("p");
            }

            return(LinqEnumerable <V> .For(_SelectMany(e, p)));
        }
コード例 #8
0
        public static LinqRoot <T> Skip <T>(IEnumerable <T> e, int n)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }
            if (n < 0)
            {
                throw new ArgumentException("n");
            }

            return(LinqEnumerable <T> .For(_Skip(e, n)));
        }
コード例 #9
0
        public static VerificationResult FailureTypeMismatch(VerifiableTracker verifier, int transitionIndex, int stackIndex, IEnumerable <TypeOnStack> expectedTypes, LinqStack <LinqList <TypeOnStack> > stack)
        {
            return
                (new VerificationResult
            {
                Success = false,

                Verifier = verifier.Clone(),
                TransitionIndex = transitionIndex,

                IsTypeMismatch = true,
                StackIndex = stackIndex,
                ExpectedAtStackIndex = LinqEnumerable <TypeOnStack> .For(expectedTypes),
                Stack = stack
            });
        }