]> git.sur5r.net Git - cc65/blobdiff - src/ca65/token.c
Finished implemenation of commands to delete macros. Added the new commands to
[cc65] / src / ca65 / token.c
index b389b85119428876d22d223f45882644cb6a1589..5fb3d2fc805270640ac9d732dea386e9765c4613 100644 (file)
@@ -60,3 +60,18 @@ int TokHasIVal (token_t Tok)
 
 
 
+void CopyToken (Token* Dst, const Token* Src)
+/* Copy a token from Src to Dst. The current value of Dst.SVal is free'd,
+ * so Dst must be initialized.
+ */
+{
+    /* Copy the fields */
+    Dst->Tok  = Src->Tok;
+    Dst->WS   = Src->WS;
+    Dst->IVal = Src->IVal;
+    SB_Copy (&Dst->SVal, &Src->SVal);
+    Dst->Pos  = Src->Pos;
+}
+
+
+