Skip to content

Commit 9035057

Browse files
committed
refactor!: make appendToken static
`appendToken` is a internal function to allocate and append a new token to the current token, which is the end of the token list. This change can prevent misuse of the function. BREAKING CHANGE: `appendToken` is no longer declared in the header or with external linkage.
1 parent 547cf84 commit 9035057

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/tokenizer.h

-2
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,3 @@ const char* tokenize(const char* src, Token** res);
5151
///
5252
/// \param tk The most parent token to free.
5353
void freeTokens(Token* tk);
54-
55-
void appendToken(Token** curr, TokenKind kind, const char* str, unsigned int num);

src/tokenizer.c

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
} \
2727
}
2828

29+
static void appendToken(Token** curr, TokenKind kind, const char* str, unsigned int num);
30+
2931
const char* tokenize(const char* src, Token** res) {
3032
Token head;
3133
head.next = NULL;

0 commit comments

Comments
 (0)