// and_test: not_test ('and' not_test)* private Expression ParseAndTest() { Expression ret = ParseNotTest(); while (MaybeEat(TokenKind.KeywordAnd)) { SourceLocation start = ret.Start; ret = new AndExpression(ret, ParseAndTest()); ret.SetLoc(start, GetEnd()); } return ret; }
// and_test: not_test ('and' not_test)* private Expression ParseAndTest() { Expression ret = ParseNotTest(); while (MaybeEat(TokenKind.KeywordAnd)) { var start = ret.StartIndex; ret = new AndExpression(ret, ParseAndTest()); ret.SetLoc(_globalParent, start, GetEnd()); } return ret; }
public override bool Walk(AndExpression node) { node.Parent = _currentScope; return base.Walk(node); }
internal BoolOp(AndExpression and) : this() { _values = PythonOps.MakeListNoCopy(Convert(and.Left), Convert(and.Right)); _op = And.Instance; }
public override void PostWalk(AndExpression node) { string right = Content(); string left = Content(); Content("{0} && {1}", left, right); CommonPostWalk(node, true); }
// This is generated by the scripts\generate_walker.py script. // That will scan all types that derive from the IronPython AST nodes that aren't interesting for scopes // and inject into here. #region Generated Python Name Binder Propagate Current Scope // *** BEGIN GENERATED CODE *** // generated by function: gen_python_name_binder from: generate_walker.py // AndExpression public override bool Walk(AndExpression node) { node.Parent = _currentScope; return(base.Walk(node)); }
public void PostWalk(AndExpression node) { PostProcess(node); }
public override bool Walk(AndExpression node) { CommonWalk(node); return true; }
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); }
// AndExpression public bool Walk(AndExpression node) { return Process(node); }
public static string Format(AndExpression node) { return(Format(node.Left) + " And " + Format(node.Right)); }
// AndExpression public virtual bool Walk(AndExpression node) { return false; }
public virtual void PostWalk(AndExpression node) { }
public string Visit(PyAst.AndExpression node) => $"({Visit(node.Left)} and {Visit(node.Right)})";
public override bool Walk(AndExpression node) { writer.WriteLine("And"); return base.Walk(node); }