예제 #1
0
파일: Parser.cs 프로젝트: techarch/ironruby
 // 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;
 }
예제 #2
0
 // 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;
 }
예제 #3
0
 public override bool Walk(AndExpression node)
 {
     node.Parent = _currentScope;
     return base.Walk(node);
 }
예제 #4
0
 internal BoolOp(AndExpression and)
     : this() {
     _values = PythonOps.MakeListNoCopy(Convert(and.Left), Convert(and.Right));
     _op = And.Instance;
 }
예제 #5
0
        public override void PostWalk(AndExpression node)
        {
            string right = Content();
            string left = Content();

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

            CommonPostWalk(node, true);
        }
예제 #6
0
        // 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);
 }
예제 #8
0
 public override bool Walk(AndExpression node)
 {
     CommonWalk(node);
     return true;
 }
예제 #9
0
파일: _ast.cs 프로젝트: TerabyteX/main
 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);
 }
예제 #11
0
 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)
 {
 }
예제 #14
0
 public string Visit(PyAst.AndExpression node) => $"({Visit(node.Left)} and {Visit(node.Right)})";
예제 #15
0
		public override bool Walk(AndExpression node)
		{
			writer.WriteLine("And");
			return base.Walk(node);
		}