Inheritance: Expression
Example #1
0
 // or_test: and_test ('or' and_test)*
 private Expression ParseOrTest() {
     Expression ret = ParseAndTest();
     while (MaybeEat(TokenKind.KeywordOr)) {
         SourceLocation start = ret.Start;
         ret = new OrExpression(ret, ParseAndTest());
         ret.SetLoc(start, GetEnd());
     }
     return ret;
 }
Example #2
0
 // or_test: and_test ('or' and_test)*
 private Expression ParseOrTest() {
     Expression ret = ParseAndTest();
     while (MaybeEat(TokenKind.KeywordOr)) {
         var start = ret.StartIndex;
         ret = new OrExpression(ret, ParseAndTest());
         ret.SetLoc(_globalParent, start, GetEnd());
     }
     return ret;
 }
Example #3
0
 public override bool Walk(OrExpression node)
 {
     node.Parent = _currentScope;
     return base.Walk(node);
 }
Example #4
0
 internal BoolOp(OrExpression or)
     : this() {
     _values = PythonOps.MakeListNoCopy(Convert(or.Left), Convert(or.Right));
     _op = Or.Instance;
 }
Example #5
0
 public override bool Walk(OrExpression node)
 {
     CommonWalk(node);
     return true;
 }
Example #6
0
        public override void PostWalk(OrExpression node)
        {
            string right = Content();
            string left = Content();

            Content("{0} || {1}", left, right);

            CommonPostWalk(node, true);
        }
 // OrExpression
 public bool Walk(OrExpression node)
 {
     return Process(node);
 }
 public void PostWalk(OrExpression node)
 {
     PostProcess(node);
 }
Example #9
0
 internal override AstExpression Revert()
 {
     if (op == And.Instance) {
         AndExpression ae = new AndExpression(
             expr.Revert(values[0]),
             expr.Revert(values[1]));
         return ae;
     } else if (op == Or.Instance) {
         OrExpression oe = new OrExpression(
             expr.Revert(values[0]),
             expr.Revert(values[1]));
         return oe;
     }
     throw PythonOps.TypeError("Unexpected boolean operator: {0}", op);
 }
 public virtual void PostWalk(OrExpression node)
 {
 }
 // OrExpression
 public virtual bool Walk(OrExpression node)
 {
     return true;
 }