14#define LEXBOR_STR_RES_MAP_LOWERCASE
18static const lxb_char_t lxb_css_syntax_tokenizer_important[] =
"important";
21lxb_css_syntax_tokenizer_cache_create(
void);
74 static const unsigned tmp_size = 1024;
91 tkz->
cache = lxb_css_syntax_tokenizer_cache_create();
92 status = lxb_css_syntax_tokenizer_cache_init(tkz->
cache, 128);
130 tkz->
chunk_cb = lxb_css_syntax_tokenizer_blank;
140 lxb_css_syntax_tokenizer_cache_clean(tkz->
cache);
165 tkz->
cache = lxb_css_syntax_tokenizer_cache_destroy(tkz->
cache);
179lxb_css_syntax_tokenizer_cache_create(
void)
232 new_size = cache->
length + up_to;
240 cache->
size = new_size;
250 if ((lxb_css_syntax_tokenizer_cache_expand(cache, 128) ==
NULL)) {
397 if (tkz->
eof ==
false) {
493 static const size_t length =
sizeof(lxb_css_syntax_tokenizer_important) - 1;
507 lxb_css_syntax_tokenizer_important,
518 return lxb_css_syntax_tokenizer_lookup_important_end(tkz,
519 p,
end, stop_ch, stop,
false);
526 || token->
type == stop
530 return lxb_css_syntax_tokenizer_lookup_important_end(tkz,
p,
end,
531 stop_ch, stop,
false);
534 return lxb_css_syntax_tokenizer_lookup_important_ch(tkz,
p,
end, stop_ch,
548 imp = lxb_css_syntax_tokenizer_important;
552 return lxb_css_syntax_tokenizer_lookup_important_tokens(tkz, stop,
556 if (lexbor_str_res_map_lowercase[*
p++] != *imp++) {
560 while (*imp != 0x00);
562 return lxb_css_syntax_tokenizer_lookup_important_end(tkz,
p,
end, stop_ch,
576 return lxb_css_syntax_tokenizer_lookup_important_tokens(tkz, stop,
593 return (stop_ch != 0x00 && stop_ch == *
p);
606 static const size_t length =
sizeof(lxb_css_syntax_tokenizer_important) - 1;
626 lxb_css_syntax_tokenizer_important,
659 switch (token->
type) {
672 return token->
type == stop_ch ||
682 return lxb_css_syntax_tokenizer_lookup_important_tokens(tkz, stop,
692 return lxb_css_syntax_tokenizer_lookup_important_ch(tkz,
p,
end,
693 stop_ch, stop,
true);
696 return (stop_ch != 0x00 && stop_ch == *
p);
void lexbor_array_obj_clean(lexbor_array_obj_t *array)
lexbor_array_obj_t * lexbor_array_obj_create(void)
lxb_status_t lexbor_array_obj_init(lexbor_array_obj_t *array, size_t size, size_t struct_size)
lexbor_array_obj_t * lexbor_array_obj_destroy(lexbor_array_obj_t *array, bool self_destroy)
@ LXB_STATUS_ERROR_MEMORY_ALLOCATION
@ LXB_STATUS_ERROR_OBJECT_IS_NULL
struct lxb_css_syntax_token lxb_css_syntax_token_t
struct lxb_css_syntax_tokenizer lxb_css_syntax_tokenizer_t
const lxb_char_t * lxb_css_syntax_state_minus_process(lxb_css_syntax_tokenizer_t *tkz, lxb_css_syntax_token_t *token, const lxb_char_t *data, const lxb_char_t *end)
const lxb_char_t * lxb_css_syntax_state_plus_process(lxb_css_syntax_tokenizer_t *tkz, lxb_css_syntax_token_t *token, const lxb_char_t *data, const lxb_char_t *end)
lxb_status_t lxb_css_syntax_token_string_make(lxb_css_syntax_tokenizer_t *tkz, lxb_css_syntax_token_t *token)
lxb_css_syntax_token_t * lxb_css_syntax_token_cached_create(lxb_css_syntax_tokenizer_t *tkz)
lxb_css_syntax_token_t * lxb_css_syntax_token_next(lxb_css_syntax_tokenizer_t *tkz)
#define lxb_css_syntax_token_ident(token)
#define lxb_css_syntax_token_base(token)
lxb_css_syntax_token_type_t
@ LXB_CSS_SYNTAX_TOKEN__EOF
@ LXB_CSS_SYNTAX_TOKEN_DELIM
@ LXB_CSS_SYNTAX_TOKEN_COLON
@ LXB_CSS_SYNTAX_TOKEN_IDENT
@ LXB_CSS_SYNTAX_TOKEN_WHITESPACE
@ LXB_CSS_SYNTAX_TOKEN_COMMENT
@ LXB_CSS_SYNTAX_TOKEN_SEMICOLON
#define lxb_css_syntax_token_delim(token)
@ LXB_CSS_SYNTAX_TOKENIZER_OPT_UNDEF
lxb_inline lxb_status_t lxb_css_syntax_tokenizer_status(lxb_css_syntax_tokenizer_t *tkz)
lxb_status_t lexbor_dobject_init(lexbor_dobject_t *dobject, size_t chunk_size, size_t struct_size)
void lexbor_dobject_clean(lexbor_dobject_t *dobject)
lexbor_dobject_t * lexbor_dobject_destroy(lexbor_dobject_t *dobject, bool destroy_self)
lexbor_dobject_t * lexbor_dobject_create(void)
bool lxb_css_syntax_tokenizer_lookup_important(lxb_css_syntax_tokenizer_t *tkz, lxb_css_syntax_token_type_t stop, const lxb_char_t stop_ch)
lxb_css_syntax_tokenizer_t * lxb_css_syntax_tokenizer_create(void)
lxb_css_syntax_tokenizer_t * lxb_css_syntax_tokenizer_destroy(lxb_css_syntax_tokenizer_t *tkz)
LXB_API lxb_status_t lxb_css_syntax_tokenizer_cache_push(lxb_css_syntax_tokenizer_cache_t *cache, lxb_css_syntax_token_t *value)
lxb_status_t lxb_css_syntax_tokenizer_init(lxb_css_syntax_tokenizer_t *tkz)
bool lxb_css_syntax_tokenizer_lookup_colon(lxb_css_syntax_tokenizer_t *tkz)
lxb_status_t lxb_css_syntax_tokenizer_status_noi(lxb_css_syntax_tokenizer_t *tkz)
lxb_css_syntax_token_t * lxb_css_syntax_tokenizer_token(lxb_css_syntax_tokenizer_t *tkz)
lxb_status_t lxb_css_syntax_tokenizer_chunk(lxb_css_syntax_tokenizer_t *tkz, const lxb_char_t *data, size_t size)
lxb_status_t lxb_css_syntax_tokenizer_next_chunk(lxb_css_syntax_tokenizer_t *tkz, const lxb_char_t **data, const lxb_char_t **end)
lxb_status_t lxb_css_syntax_tokenizer_clean(lxb_css_syntax_tokenizer_t *tkz)
bool lxb_css_syntax_tokenizer_lookup_declaration_ws_end(lxb_css_syntax_tokenizer_t *tkz, lxb_css_syntax_token_type_t stop, const lxb_char_t stop_ch)
LXB_API void * lexbor_realloc(void *dst, size_t size)
LXB_API void * lexbor_free(void *dst)
LXB_API void * lexbor_malloc(size_t size)
LXB_API void * lexbor_calloc(size_t num, size_t size)
lexbor_mraw_t * lexbor_mraw_create(void)
void lexbor_mraw_clean(lexbor_mraw_t *mraw)
lxb_status_t lexbor_mraw_init(lexbor_mraw_t *mraw, size_t chunk_size)
lexbor_mraw_t * lexbor_mraw_destroy(lexbor_mraw_t *mraw, bool destroy_self)
unsigned const char * end
bool lexbor_str_data_ncasecmp(const lxb_char_t *first, const lxb_char_t *sec, size_t size)
lxb_css_syntax_token_type_t type
lxb_css_syntax_token_t ** list
lexbor_array_obj_t * parse_errors
const lxb_char_t * in_begin
lexbor_dobject_t * tokens
lxb_css_syntax_tokenizer_cache_t * cache
const lxb_char_t * in_end
lxb_css_syntax_tokenizer_chunk_f chunk_cb
unsigned int lxb_status_t