Commit 40626e47 authored by Guillaume Charifi's avatar Guillaume Charifi

compiler/lexer: Remove token_insert_after().

parent 88a1b71d
......@@ -590,23 +590,3 @@ int token_replace(struct lexer_output *out, unsigned long id, struct bm_token *t
out->tokens[id] = *token;
return 0;
}
int token_insert_after(struct lexer_output *out, unsigned long id, struct bm_token *token)
{
struct bm_token *tokens;
if (id >= out->nb_tokens)
return -1;
tokens = realloc(out->tokens, (out->nb_tokens + 1) * sizeof(out->tokens[0]));
if (!tokens)
return -1;
out->tokens = tokens;
if (id != out->nb_tokens - 1)
memmove(&out->tokens[id + 2], &out->tokens[id + 1], (out->nb_tokens - id - 1) * sizeof(out->tokens[0]));
out->tokens[id + 1] = *token;
out->nb_tokens++;
return 0;
}
......@@ -38,6 +38,5 @@ extern int token_deinit(struct bm_token *token);
extern int lexer(const wchar_t *in, struct lexer_output *out);
extern int lexer_destroy(struct lexer_output *out);
extern int token_replace(struct lexer_output *out, unsigned long id, struct bm_token *token);
extern int token_insert_after(struct lexer_output *out, unsigned long id, struct bm_token *token);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment