Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 void HandleLocalFunctionStatement(LocalFunctionStatement tree)
 {
     InsertName(tree.name.m_string, GetNextRegisterId());
     HandleFunctionBody(tree.func_body, tree.name.m_string);
     GenerateRegisterId();
 }