Add a New Comment (Rich Markup)
Comment Type & Canned Response: None None Please use the bug tracker for bugs
Note: The patch accidentally has tabs in it. I'll remove them in the next version, but will wait for feedback first.
This patch gives users a hint about where a missing or spurious "end" (or "endif" or "endfor" etc.) might be.
It uses the heuristic that the "end" should start at the same level of indentation as the "if" or whatever, or perhaps be on the same line as the "if". It records if/end pairs for which that doesn't occur. If an error occurs that is likely to be due to mismatched ends, it augments the error message with a note telling the user the innermost pair that start in different columns.
This is most useful for those of us who have to write Matlab-compatible code, since the dedicated forms of endXYZ provide some help with this, but in deeply nested "if" or "for" statements, it still reduces the ambiguity.
If users have a coding style in which the "end" is supposed to have a different indent, this will not create excess diagnostics, since it only prints anything when an error occurs. Also, the output is only of the form
Note: The if on line W column X matches the end on line Y column Z.
which doesn't say that that is the cause of the error.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 2 latest changes.
Copyright © 2022 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.9