# HG changeset patch # User John W. Eaton # Date 1297153332 18000 # Node ID 5252f12537f8a1006ea81c9b76ebba108d663788 # Parent 824b3e0ab12a237ba1e69450fe963d490aa5c534 don't warn about coercing nested functions to subfunctions if yyparse failed diff -r 824b3e0ab12a -r 5252f12537f8 ChangeLog --- a/ChangeLog Sun Feb 06 21:11:01 2011 -0500 +++ b/ChangeLog Tue Feb 08 03:22:12 2011 -0500 @@ -1,3 +1,7 @@ +2011-02-08 John W. Eaton + + * NEWS: Add note about subfunctions. + 2011-02-06 John W. Eaton * PROJECTS, README.devel: Use maintainers@octave.org instead of diff -r 824b3e0ab12a -r 5252f12537f8 NEWS --- a/NEWS Sun Feb 06 21:11:01 2011 -0500 +++ b/NEWS Tue Feb 08 03:22:12 2011 -0500 @@ -575,6 +575,18 @@ the lines "s *= y;" and "t = y + x" will not be executed. + ** If any subfunction in a file ends with "end" or "endfunction", then + they all must end that way. Previously, Octave accepted + + function main () + ... + # no endfunction here. + function sub () + ... + endfunction + + but this is no longer allowed. + ** Special treatment in the parser of expressions like "a' * b". In these cases the transpose is no longer explicitly formed and diff -r 824b3e0ab12a -r 5252f12537f8 src/ChangeLog --- a/src/ChangeLog Sun Feb 06 21:11:01 2011 -0500 +++ b/src/ChangeLog Tue Feb 08 03:22:12 2011 -0500 @@ -1,3 +1,8 @@ +2011-02-08 John W. Eaton + + * oct-parse.yy (parse_fcn_file): Don't warn about coercing + nested functions to subfunctions if yyparse failed. + 2011-02-06 Konstantinos Poulios * graphics.h.in (class axes::properties): Tag positionmode, diff -r 824b3e0ab12a -r 5252f12537f8 src/oct-parse.yy --- a/src/oct-parse.yy Sun Feb 06 21:11:01 2011 -0500 +++ b/src/oct-parse.yy Tue Feb 08 03:22:12 2011 -0500 @@ -3589,14 +3589,14 @@ fcn_ptr = primary_fcn_ptr; - if (reading_fcn_file && endfunction_found && max_function_depth > 1) + if (status != 0) + error ("parse error while reading %s file %s", + file_type.c_str(), ff.c_str ()); + else if (reading_fcn_file && endfunction_found + && max_function_depth > 1) warning_with_id ("Octave:nested-functions-coerced", "nested functions are coerced into subfunctions " "in file %s", ff.c_str ()); - - if (status != 0) - error ("parse error while reading %s file %s", - file_type.c_str(), ff.c_str ()); } else {