// 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; }
// EmptyStatement public override bool Walk(EmptyStatement node) { node.Parent = _currentScope; return(base.Walk(node)); }
public override bool Walk(EmptyStatement node) { Content(""); return true; }
public override void PostWalk(EmptyStatement node) { }
public void Visit(PyAst.EmptyStatement node) => AppendLineWithIndentation("pass");