# HG changeset patch # User jwe # Date 859586674 0 # Node ID 2284b26520286fbfc5eb19d9400f704a7aed2878 # Parent b960bd6cbfdfad8bea6e6723feba8277a21e4a78 [project @ 1997-03-28 22:04:30 by jwe] diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ Summary of changes for version 2.1: ---------------------------------- + * Commas in global statements are no longer special. They are now + treated as command separators. This removes a conflict in the + grammar and is consistent with the way Matlab behaves. + * It is now possible to declare static variables that retain their values across function calls. For example, diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ Fri Mar 28 15:33:11 1997 John W. Eaton + * parse.y (Vwarn_comma_in_declaration): Delete. + (symbols_of_parse): Delete DEFVAR for warn_comma_in_declaration. + (decl1): Don't allow commas in declarations. + * lsode.cc (struct LSODE_OPTIONS): Handle integer options. (print_lsode_option_list, set_lsode_option, show_lsode_option): Ditto. (lsode_option_table): Add element for step limit. diff --git a/src/parse.y b/src/parse.y --- a/src/parse.y +++ b/src/parse.y @@ -75,12 +75,6 @@ // If TRUE, generate a warning for variable swich labels. static bool Vwarn_variable_switch_label; -// If TRUE, generate a warning for the comma in things like -// -// octave> global a, b = 2 -// -static bool Vwarn_comma_in_declaration; - // If TRUE, generate warning if declared function name disagrees with // the name of the file in which it is defined. static bool Vwarn_function_name_clash; @@ -249,9 +243,6 @@ // Maybe print a warning. Duh. static void maybe_warn_missing_semi (tree_statement_list *); -// Maybe print a warning. Duh. -static void maybe_warn_comma_in_decl (void); - // Set the print flag for a statement based on the separator type. static void set_stmt_print_flag (tree_statement_list *, char, bool); @@ -614,12 +605,6 @@ $1->append ($2); $$ = $1; } - | decl1 ',' decl2 - { - maybe_warn_comma_in_decl (); - $1->append ($3); - $$ = $1; - } ; decl2 : identifier @@ -2393,19 +2378,6 @@ } } -static void -maybe_warn_comma_in_decl (void) -{ - if (Vwarn_comma_in_declaration)\ - { - warning ("comma in declaration not interpreted as a command separator"); - - if (reading_fcn_file || reading_script_file) - warning ("near line %d of file `%s'", input_line_number, - curr_fcn_file_full_name.c_str ()); - } -} - static int warn_assign_as_truth_value (void) { @@ -2416,14 +2388,6 @@ } static int -warn_comma_in_declaration (void) -{ - Vwarn_comma_in_declaration = check_preference ("warn_comma_in_declaration"); - - return 0; -} - -static int warn_function_name_clash (void) { Vwarn_function_name_clash = check_preference ("warn_function_name_clash"); @@ -2454,9 +2418,6 @@ DEFVAR (warn_assign_as_truth_value, 1.0, 0, warn_assign_as_truth_value, "produce warning for assignments used as truth values"); - DEFVAR (warn_comma_in_declaration, 1.0, 0, warn_comma_in_declaration, - "produce warning for commas in declaration statements"); - DEFVAR (warn_function_name_clash, 1.0, 0, warn_function_name_clash, "produce warning if function name conflicts with file name");