Fix wrong line info sometimes output for macros: When macro parameters were

expanded, the line info came from the parameter replacement list, but was
marked as coming from the macro. Now parameter replacement lists don't change
the line info.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5051 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-06-13 08:53:41 +00:00
parent d1426aaa43
commit ff9841d7b5
5 changed files with 28 additions and 22 deletions

View File

@@ -82,17 +82,20 @@ void FreeTokNode (TokNode* N)
void TokSet (TokNode* N, unsigned LineInfoSlot)
/* Set the scanner token from the given token node. The given line info slot
* is used to store the position of the token fed into the scanner.
void TokSet (TokNode* N, int LineInfoSlot)
/* Set the scanner token from the given token node. If the given line info
* slot is not LI_SLOT_INV, it is used to store the position of the token fed
* into the scanner.
*/
{
/* Set the values */
CopyToken (&CurTok, &N->T);
SB_Terminate (&CurTok.SVal);
/* Set the position */
GenLineInfo (LineInfoSlot, &CurTok.Pos);
/* Set the position if the slot is not invald */
if (LineInfoSlot != LI_SLOT_INV) {
GenLineInfo (LineInfoSlot, &CurTok.Pos);
}
}