Branch: Tag:

2002-05-05

2002-05-05 13:03:42 by Martin Stjernholm <mast@lysator.liu.se>

Added new keyword global to be able to access identifiers on the top level
of the compilation unit using global::foo. (Deactivated in 7.2 compatibility
mode, of course.)

Rev: src/language.yacc:1.276
Rev: src/lexer.h:1.36
Rev: src/testsuite.in:1.509

55:   %token TOK_FOR   %token TOK_FUNCTION_ID   %token TOK_GAUGE + %token TOK_GLOBAL   %token TOK_IDENTIFIER   %token TOK_IF   %token TOK_IMPORT
112:   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.275 2002/05/05 00:28:30 mast Exp $"); + RCSID("$Id: language.yacc,v 1.276 2002/05/05 13:03:42 mast Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif
3292:    free_node($1);    $$ = e;    } +  | TOK_GLOBAL TOK_COLON_COLON +  { +  inherit_state = Pike_compiler; +  for (inherit_depth = 0; inherit_depth < compilation_depth; +  inherit_depth++, inherit_state = inherit_state->previous) {} +  $$ = 0; +  }    | inherit_specifier TOK_IDENTIFIER TOK_COLON_COLON    {    if ($1 >= 0) {