Improved error handling and diagnostics with failed macro definitions.
This commit is contained in:
@@ -1004,6 +1004,7 @@ static void DoDefine (void)
|
|||||||
if (CurC != '.' || NextC != '.') {
|
if (CurC != '.' || NextC != '.') {
|
||||||
PPError ("'...' expected");
|
PPError ("'...' expected");
|
||||||
ClearLine ();
|
ClearLine ();
|
||||||
|
FreeMacro (M);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NextChar ();
|
NextChar ();
|
||||||
@@ -1043,8 +1044,9 @@ static void DoDefine (void)
|
|||||||
|
|
||||||
/* Check for a right paren and eat it if we find one */
|
/* Check for a right paren and eat it if we find one */
|
||||||
if (CurC != ')') {
|
if (CurC != ')') {
|
||||||
PPError ("')' expected");
|
PPError ("')' expected for macro definition");
|
||||||
ClearLine ();
|
ClearLine ();
|
||||||
|
FreeMacro (M);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NextChar ();
|
NextChar ();
|
||||||
|
|||||||
Reference in New Issue
Block a user