상속: Statement
예제 #1
0
        // funcdef: [decorators] 'def' NAME parameters ':' suite
        // 2.6: 
        //  decorated: decorators (classdef | funcdef)
        // this gets called with "@" look-ahead
        private Statement ParseDecorated() {
            List<Expression> decorators = ParseDecorators();

            Statement res;

            if (PeekToken() == Tokens.KeywordDefToken) {
                FunctionDefinition fnc = ParseFuncDef();
                fnc.Decorators = decorators.ToArray();
                res = fnc;
            } else if (PeekToken() == Tokens.KeywordClassToken) {
                ClassDefinition cls = ParseClassDef();
                cls.Decorators = decorators.ToArray();
                res = cls;
            } else {
                res = new EmptyStatement();
                ReportSyntaxError(_lookahead);
            }
            
            return res;
        }
예제 #2
0
 // EmptyStatement
 public override bool Walk(EmptyStatement node)
 {
     node.Parent = _currentScope;
     return(base.Walk(node));
 }
예제 #3
0
        public override bool Walk(EmptyStatement node)
        {
            Content("");

            return true;
        }
예제 #4
0
 public override void PostWalk(EmptyStatement node)
 {
 }
예제 #5
0
 public void Visit(PyAst.EmptyStatement node) => AppendLineWithIndentation("pass");