mirror of
https://github.com/cc65/cc65.git
synced 2025-01-06 06:33:34 +00:00
Merge pull request #1998 from bbbradsmith/ca65_local_scope_error_info
ca65 improve error for unclosed scopes
This commit is contained in:
commit
d810b12c6d
@ -570,7 +570,18 @@ void SymCheck (void)
|
|||||||
|
|
||||||
/* Check for open scopes */
|
/* Check for open scopes */
|
||||||
if (CurrentScope->Parent != 0) {
|
if (CurrentScope->Parent != 0) {
|
||||||
Error ("Local scope was not closed");
|
if (CurrentScope->Label) {
|
||||||
|
/* proc has a label indicating the line it was opened. */
|
||||||
|
LIError (&CurrentScope->Label->DefLines,
|
||||||
|
"Local proc '%s' was not closed",
|
||||||
|
GetString (CurrentScope->Name));
|
||||||
|
} else {
|
||||||
|
/* scope has no label to track a line number, uses end-of-document line instead.
|
||||||
|
** Anonymous scopes will reveal their internal automatic name.
|
||||||
|
*/
|
||||||
|
Error ("Local scope '%s' was not closed",
|
||||||
|
GetString (CurrentScope->Name));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First pass: Walk through all symbols, checking for undefined's and
|
/* First pass: Walk through all symbols, checking for undefined's and
|
||||||
|
Loading…
Reference in New Issue
Block a user