]> git.sur5r.net Git - cc65/blobdiff - src/ca65/toklist.c
Finished implemenation of commands to delete macros. Added the new commands to
[cc65] / src / ca65 / toklist.c
index 12e125e67cb2ece98f8b424ce8a2b13be1557627..44fbd77427953d6a31be8bf209de1ecf772fd435 100644 (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.