Exemple #1
0
        void ComprehensionExpr(ElaExpression sel, out ElaComprehension exp)
        {
            var it = default(ElaGenerator);
            var ot = t;

            Expect(26);
            ComprehensionEntry(sel, out it);
            exp = new ElaComprehension(ot) { Generator = it };
        }
Exemple #2
0
        void ParamList(out List<ElaExpression> list, out ElaComprehension comp, out ElaRange rng )
        {
            var exp = default(ElaExpression);
            list = null;
            comp = null;
            rng = null;

            Expr(out exp);
            if (la.kind == 26 || la.kind == 56 || la.kind == 58) {
            if (la.kind == 26) {
                ComprehensionExpr(exp, out comp);
            } else if (la.kind == 58) {
                RangeExpr(exp, null, out rng);
            } else {
                var oexp = exp;
                Get();
                Expr(out exp);
                if (la.kind == 58) {
                    RangeExpr(oexp, exp, out rng);
                } else if (la.kind == 22 || la.kind == 56) {
                    list = new List<ElaExpression>();
                    list.Add(oexp);
                    list.Add(exp);

                    while (la.kind == 56) {
                        Get();
                        Expr(out exp);
                        list.Add(exp);
                    }
                } else SynErr(76);
            }
            }
            if (list == null && comp == null && rng == null && exp != null)
            {
            list = new List<ElaExpression>();
            list.Add(exp);
            }
        }