MATLAB: Do the Try-Catch Statements show an error in the editor but run fine in the Command Window

cell modeMATLAB

Try this line from command line. There is no syntax error in try-catch-end.
try bad_function_name(1); catch warning('one'); end
Now use the following in the MATLAB Editor:
%%1st cell
%%2nd cell
try bad_function_name(1); catch warning('one'); end
MATLAB M-lint will show a "PARSE ERROR" with the Catch statement :
"Parse error at '(': usage might be invalid MATLAB syntax."
Due to a Parse Error in the Editor cell mode highlighting gets disrupted. However, if it were an error MATLAB should throw the error at the command prompt as well.
Is this a issue with the MATLAB parser or the CATCH statement?
Is it a discrepancy with the syntax or is it an issue with the M-lint message showing up as a "Parse Error" rather than a "WARNING"/"Suggestion" which will not effect the cell mode functionality.

Best Answer

The MATLAB syntax for Try-Catch blocks changed several releases ago when CATCH started to take an identifier.
To make this unambiguous, a separator (comma, semicolon, or newline) is now required between the CATCH keyword (and possible identifier following it) and the statement that follows the CATCH. For a couple of releases, M-Lint warned and MATLAB accepted the old syntax as well. Now, M-Lint considers this to be a syntax error.
Using something like the following
... ; catch, warning('one'); ...
should fix the problem.
The error message complains about the '(' because that's the first time M-Lint knows that the identifier following the CATCH is not followed by a separator.
Coming to the point where the statement works fine in the MATLAB Command Window. Eventually, MATLAB will start throwing an error/warning about this, but at this point M-Lint is trying to get users to change their code so that when MATLAB changes the impact will be minimal.