# HG changeset patch # User John W. Eaton # Date 1297153332 18000 # Node ID 187d48827b472a8951ac79a6cb64e00db022bc5e # Parent 75049b56fa35ab1a7c28aa4c3e3f32c884f790f5 don't warn about coercing nested functions to subfunctions if yyparse failed diff -r 75049b56fa35 -r 187d48827b47 ChangeLog --- a/ChangeLog Sun Feb 06 21:11:01 2011 -0500 +++ b/ChangeLog Tue Feb 08 03:22:12 2011 -0500 @@ -14,6 +14,10 @@ (OCTAVE_API_VERSION_NUMBER): Now 45. (OCTAVE_RELEASE_DATE): Now 2011-01-31. +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 75049b56fa35 -r 187d48827b47 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 75049b56fa35 -r 187d48827b47 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 75049b56fa35 -r 187d48827b47 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 {