Open DavidSagan opened 10 months ago
modify the error message so that it gave where the unmatched block started (line 2 in this example)
Technically, the if
is closed by the end
on line 4. What the error is saying is that the function f1
is missing its closing end
, f2
is seen as defined inside the body of f1
. How can the parser possibly figure out the user misspelled the closing end
of the if
?
@giordano Yes you are correct. I should have said that it would be useful to give where the unmatched block started which is indeed the function f1()
line (line 1). This does not alter the fact that it would be useful to know where the unmatched block begins.
Indeed adding where the block started would make a lot easier to spot where you missed an end
which is something happening a lot to me, a reminiscence of python :D
Using: Julia 1.10.0 Consider the following test file:
There is a typo in
f1
andendif
should beend
. Loading this file generates the error message:The problem is that the line number given by the error message is the line at the end of the file. In a real life situation the file could be hundreds or more lines long so the error message is fairly useless in terms of localizing the error. Trying to find where the error can thus be a lengthy process of dividing the file into half, testing, and then further dividing, etc., until the error is localized.
As a feature request, if it were possible to modify the error message so that it gave where the unmatched block started (line 2 in this example) this would be very useful and substantially cut down on debugging time.