Create separate line infos for macros and .repeat statements and other token

lists. These are also output as diagnostic in case of an error.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4951 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-01-29 20:24:44 +00:00
parent 1072edb0d8
commit f0a0095c25
3 changed files with 33 additions and 19 deletions

View File

@@ -42,6 +42,7 @@
/* ca65 */
#include "error.h"
#include "istack.h"
#include "lineinfo.h"
#include "nexttok.h"
#include "scanner.h"
#include "toklist.h"
@@ -81,12 +82,17 @@ void FreeTokNode (TokNode* N)
void TokSet (TokNode* N)
/* Set the scanner token from the given token node */
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.
*/
{
/* Set the values */
CopyToken (&CurTok, &N->T);
SB_Terminate (&CurTok.SVal);
/* Set the position */
GenLineInfo (LineInfoSlot, &CurTok.Pos);
}
@@ -218,7 +224,7 @@ static int ReplayTokList (void* List)
CHECK (L->Last != 0);
/* Set the next token from the list */
TokSet (L->Last);
TokSet (L->Last, LI_SLOT_ASM);
/* If a check function is defined, call it, so it may look at the token
* just set and changed it as apropriate.