/* ca65 */
#include "error.h"
#include "istack.h"
+#include "lineinfo.h"
#include "nexttok.h"
#include "scanner.h"
#include "toklist.h"
-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);
}
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.