Exemple #1
0
        // boolOp: [boolOp ("&&" | "||")] equals
        AstNode BoolOp()
        {
            var a = Equals();

            for (;;)
            {
                Pos p = pos;

                if (Consume(TT.And))
                {
                    a = new AstNode.And(p, a, Equals());
                }
                else if (Consume(TT.Or))
                {
                    a = new AstNode.Or(p, a, Equals());
                }
                else
                {
                    return(a);
                }
            }
        }
Exemple #2
0
        public EvalObject Visit(AstNode.And v)
        {
            var a = Eval(v.a);

            return(a.BoolValue ? Eval(v.b) : a);
        }