System/Libraries/Css/Tokenizer: Allow descendant combinator in matches
This commit is contained in:
parent
652396a18c
commit
ae408a4679
1 changed files with 7 additions and 0 deletions
|
@ -68,6 +68,7 @@ Bool @css_try_append_match(@css_tokenizer* t)
|
||||||
U8* match;
|
U8* match;
|
||||||
if (FifoU8Cnt(t->match_fifo)) {
|
if (FifoU8Cnt(t->match_fifo)) {
|
||||||
match = @json_string_from_fifo(t->match_fifo, Fs);
|
match = @json_string_from_fifo(t->match_fifo, Fs);
|
||||||
|
String.Trim(match);
|
||||||
t->current_rule->a("matches")->append(match);
|
t->current_rule->a("matches")->append(match);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -104,6 +105,7 @@ U0 @css_tokenize_and_create_rules_from_buffer(JsonArray* rules, U8* buffer, I64
|
||||||
@css_init_tokenizer(&t, buffer, size, mem_task);
|
@css_init_tokenizer(&t, buffer, size, mem_task);
|
||||||
I64 brace_depth = 0;
|
I64 brace_depth = 0;
|
||||||
JsonItem* item;
|
JsonItem* item;
|
||||||
|
U8 check_whitespace_char;
|
||||||
while (t.pos < t.size) {
|
while (t.pos < t.size) {
|
||||||
I64 token = t.buffer[t.pos];
|
I64 token = t.buffer[t.pos];
|
||||||
switch (t.state) {
|
switch (t.state) {
|
||||||
|
@ -250,6 +252,11 @@ U0 @css_tokenize_and_create_rules_from_buffer(JsonArray* rules, U8* buffer, I64
|
||||||
case '\t':
|
case '\t':
|
||||||
case '\r':
|
case '\r':
|
||||||
case '\n':
|
case '\n':
|
||||||
|
FifoU8Peek(t.match_fifo, &check_whitespace_char);
|
||||||
|
if (check_whitespace_char != ' ') {
|
||||||
|
FifoU8Ins(t.match_fifo, ' ');
|
||||||
|
}
|
||||||
|
break;
|
||||||
case ',':
|
case ',':
|
||||||
if (FifoU8Cnt(t.match_fifo))
|
if (FifoU8Cnt(t.match_fifo))
|
||||||
@css_try_append_match(&t);
|
@css_try_append_match(&t);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue