Assertion stuff...
This commit is contained in:
15
source/hl.h
15
source/hl.h
@ -38,6 +38,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
hl_group_t * hl;
|
||||
token_type_t t;
|
||||
int lmao;
|
||||
regex_t * syntax;
|
||||
} token_t;
|
||||
|
||||
@ -95,6 +96,8 @@ int new_symbol_tokens(const char * const * symbols,
|
||||
while (*symbols) {
|
||||
if(new_symbol_token(*symbols, g)) {
|
||||
++i;
|
||||
} else {
|
||||
assert(!"Kinda failed to new symbol token thing.");
|
||||
}
|
||||
++symbols;
|
||||
}
|
||||
@ -114,6 +117,8 @@ int new_char_tokens(const char * characters,
|
||||
buffer[1] = *s;
|
||||
if(new_symbol_token(is_magic(*s) ? buffer : buffer + 1, g)) {
|
||||
++i;
|
||||
} else {
|
||||
assert(!"Kinda failed to new char token thing.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,9 +196,9 @@ int token_fits(const token_t * const token,
|
||||
void render_string(const char * const string,
|
||||
const char * const mode) {
|
||||
for (const char * s = string; *s != '\00';) {
|
||||
int f = 0;
|
||||
int f = 0;
|
||||
size_t token_index = 0;
|
||||
int offset;
|
||||
int offset = 0;
|
||||
|
||||
for (; token_index < token_table.element_count; token_index++) {
|
||||
token_t * t = vector_get(&token_table,
|
||||
@ -240,9 +245,9 @@ hl_group_t * preprocessor_hl = NULL;
|
||||
hl_group_t * symbol_hl = NULL;
|
||||
|
||||
int hl_init(void) {
|
||||
vector_init(&token_table,
|
||||
token_table.element_size,
|
||||
token_table.element_count);
|
||||
//~vector_init(&token_table,
|
||||
//~token_table.element_size,
|
||||
//~token_table.element_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user