LocalFunctionStatement ParseLocalFunction() { NextToken();// skip 'function' var statement = new LocalFunctionStatement(_current.m_line); if (NextToken().m_type != (int)TokenType.NAME) { throw NewParserException("expect 'id' after 'local function'", _current); } statement.name = _current; statement.func_body = ParseFunctionBody(); return(statement); }
void HandleLocalFunctionStatement(LocalFunctionStatement tree) { InsertName(tree.name.m_string, GetNextRegisterId()); HandleFunctionBody(tree.func_body, tree.name.m_string); GenerateRegisterId(); }