summaryrefslogtreecommitdiff
path: root/token.c
diff options
context:
space:
mode:
authorkdx <kdx.42@42l.fr>2023-03-17 05:36:27 +0000
committerkdx <kdx.42@42l.fr>2023-03-17 05:37:36 +0000
commit3ca9bd11165cc86bc38334cac5a0b30fe0e946b9 (patch)
treea48df33cafc1478bb2958305cbd57d4441aaac10 /token.c
parent2bc0161433869d21a8c99779f39ce2f932389ea0 (diff)
downloadgolem-3ca9bd11165cc86bc38334cac5a0b30fe0e946b9.tar.gz
note string_ptr in token
Diffstat (limited to 'token.c')
-rw-r--r--token.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/token.c b/token.c
index 6ec9f40..dbe4125 100644
--- a/token.c
+++ b/token.c
@@ -14,6 +14,7 @@ token_create(Slice slice, unsigned int type)
}
token->slice = slice;
token->type = type;
+ token->string_ptr = 0;
token->prev = NULL;
token->next = NULL;
return token;
@@ -120,8 +121,12 @@ token_print(Token *token, int recurse, int depth)
token_print(token->group.scope, 1, depth);
token_print(token->group.tokens, 1, depth + 1);
} else {
- printf("type: %c slice: ", token->type);
- slice_print(token->slice);
+ printf("type: %c slice: \"", token->type);
+ slice_write(token->slice);
+ printf("\"");
+ if (token->type == TOK_STRING)
+ printf(" string_ptr: %ld", token->string_ptr);
+ printf("\n");
}
if (!recurse)
return tok;