Mercurial > octave
diff src/oct-parse.yy @ 14294:9e3983c8963c
deprecate the static keyword
* octave.gperf: Use PERSISTENT as the token for "static" and
"persistent" but use separate static_kw and persistent_kw values so we
can distinguish them.
* lex.ll (is_keyword_token): Handle static_kw and persistent_kw
separately. Generate deprecated keyword warning for static_kw.
* oct-parse.cc: Use PERSISTENT token instead of STATIC.
* pt-decl.h, pt-decl.cc (tree_persistent_command): Rename from
tree_static_command. Change all uses.
* pt-walk.h (tree_walker::visit_persistent_command):
Rename from visit_static_command. Change all derived classes.
* NEWS: note that static has been deprecated.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 30 Jan 2012 23:42:41 -0500 |
parents | 71a198cca35b |
children | 8d1ae996c122 |
line wrap: on
line diff
--- a/src/oct-parse.yy Mon Jan 30 23:06:01 2012 -0500 +++ b/src/oct-parse.yy Mon Jan 30 23:42:41 2012 -0500 @@ -446,7 +446,7 @@ %token <tok_val> BREAK CONTINUE FUNC_RET %token <tok_val> UNWIND CLEANUP %token <tok_val> TRY CATCH -%token <tok_val> GLOBAL STATIC +%token <tok_val> GLOBAL PERSISTENT %token <tok_val> FCN_HANDLE %token <tok_val> PROPERTIES METHODS EVENTS ENUMERATION %token <tok_val> METAQUERY @@ -997,9 +997,9 @@ $$ = make_decl_command (GLOBAL, $1, $3); lexer_flags.looking_at_decl_list = false; } - | STATIC parsing_decl_list decl1 + | PERSISTENT parsing_decl_list decl1 { - $$ = make_decl_command (STATIC, $1, $3); + $$ = make_decl_command (PERSISTENT, $1, $3); lexer_flags.looking_at_decl_list = false; } ; @@ -3091,9 +3091,9 @@ retval = new tree_global_command (lst, l, c); break; - case STATIC: + case PERSISTENT: if (current_function_depth > 0) - retval = new tree_static_command (lst, l, c); + retval = new tree_persistent_command (lst, l, c); else { if (reading_script_file)