--- oct-parse.in.yy~ 2013-03-15 14:04:48.221324825 -0400 +++ oct-parse.in.yy 2013-03-15 14:09:01.701883044 -0400 @@ -1002,7 +1002,10 @@ parser_symtab_context.push (); - symbol_table::set_scope (symbol_table::alloc_scope ()); + symbol_table::scope_id id = symbol_table::alloc_scope (); + std::cerr << "allocated scope " << id + << " for function" << std::endl; + symbol_table::set_scope (id); parser.function_scopes.push_back (symbol_table::current_scope ()); @@ -1011,6 +1014,15 @@ && ! parser.parsing_subfunctions) parser.primary_fcn_scope = symbol_table::current_scope (); + std::cerr << "lexer.reading_script_file " + << lexer.reading_script_file << std::endl; + std::cerr << "parser.curr_fcn_depth " + << parser.curr_fcn_depth << std::endl; + std::cerr << "parser.parsing_subfunctions " + << parser.parsing_subfunctions << std::endl; + std::cerr << "parser.primary_fcn_scope " + << parser.primary_fcn_scope << std::endl; + if (lexer.reading_script_file && parser.curr_fcn_depth > 1) parser.bison_error ("nested functions not implemented in this context");