diff src/oct-parse.yy @ 12408:187d48827b47 release-3-4-x

don't warn about coercing nested functions to subfunctions if yyparse failed
author John W. Eaton <jwe@octave.org>
date Tue, 08 Feb 2011 03:22:12 -0500
parents 1b71befc2f40
children 7a5aacf65f81
line wrap: on
line diff
--- 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
         {