forked from len0rd/rockbox
Revert "skin_engine: rework the parser to be closer to the langauge grammar."
This reverts commit ec8b21eef8b2fe1bd02f335dbc0dfbf05c2deff2 which was pushed by accident. Change-Id: I1aaedf6876d0448a100dc582b79f1293d021bac1 Reviewed-on: http://gerrit.rockbox.org/216 Reviewed-by: Thomas Martitz <kugel@rockbox.org>
This commit is contained in:
parent
e43b856ed0
commit
728db21502
3 changed files with 80 additions and 57 deletions
|
|
@ -182,12 +182,26 @@ static struct skin_element* skin_parse_viewport(const char** document)
|
|||
}
|
||||
else if(*cursor == TAGSYM)
|
||||
{
|
||||
skip_tag(&cursor);
|
||||
/* A ';' directly after a '%' doesn't count */
|
||||
cursor ++;
|
||||
|
||||
if(*cursor == '\0')
|
||||
break;
|
||||
|
||||
cursor++;
|
||||
}
|
||||
else if(*cursor == COMMENTSYM)
|
||||
{
|
||||
skip_comment(&cursor);
|
||||
}
|
||||
else if(*cursor == ARGLISTOPENSYM)
|
||||
{
|
||||
skip_arglist(&cursor);
|
||||
}
|
||||
else if(*cursor == ENUMLISTOPENSYM)
|
||||
{
|
||||
skip_enumlist(&cursor);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Advancing the cursor as normal */
|
||||
|
|
@ -431,9 +445,20 @@ static struct skin_element* skin_parse_sublines_optional(const char** document,
|
|||
{
|
||||
skip_comment(&cursor);
|
||||
}
|
||||
else if(*cursor == ENUMLISTOPENSYM)
|
||||
{
|
||||
skip_enumlist(&cursor);
|
||||
}
|
||||
else if(*cursor == ARGLISTOPENSYM)
|
||||
{
|
||||
skip_arglist(&cursor);
|
||||
}
|
||||
else if(*cursor == TAGSYM)
|
||||
{
|
||||
skip_tag(&cursor);
|
||||
cursor++;
|
||||
if(*cursor == '\0' || *cursor == '\n')
|
||||
break;
|
||||
cursor++;
|
||||
}
|
||||
else if(*cursor == MULTILINESYM)
|
||||
{
|
||||
|
|
@ -570,12 +595,19 @@ static int skin_parse_tag(struct skin_element* element, const char** document)
|
|||
/* Skipping over escaped characters */
|
||||
if(*cursor == TAGSYM)
|
||||
{
|
||||
skip_tag(&cursor);
|
||||
cursor++;
|
||||
if(*cursor == '\0')
|
||||
break;
|
||||
cursor++;
|
||||
}
|
||||
else if(*cursor == COMMENTSYM)
|
||||
{
|
||||
skip_comment(&cursor);
|
||||
}
|
||||
else if(*cursor == ARGLISTOPENSYM)
|
||||
{
|
||||
skip_arglist(&cursor);
|
||||
}
|
||||
else if(*cursor == ARGLISTSEPARATESYM)
|
||||
{
|
||||
num_args++;
|
||||
|
|
@ -942,9 +974,18 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc
|
|||
{
|
||||
skip_comment(&cursor);
|
||||
}
|
||||
else if(*cursor == ENUMLISTOPENSYM)
|
||||
{
|
||||
if (*cursor == '\n')
|
||||
cursor++;
|
||||
skip_enumlist(&cursor);
|
||||
}
|
||||
else if(*cursor == TAGSYM)
|
||||
{
|
||||
skip_tag(&cursor);
|
||||
cursor++;
|
||||
if(*cursor == '\0' || *cursor == '\n')
|
||||
break;
|
||||
cursor++;
|
||||
}
|
||||
else if(*cursor == ENUMLISTSEPARATESYM)
|
||||
{
|
||||
|
|
@ -1098,7 +1139,21 @@ static struct skin_element* skin_parse_code_as_arg(const char** document)
|
|||
}
|
||||
else if(*cursor == TAGSYM)
|
||||
{
|
||||
skip_tag(&cursor);
|
||||
/* A ';' directly after a '%' doesn't count */
|
||||
cursor ++;
|
||||
|
||||
if(*cursor == '\0')
|
||||
break;
|
||||
|
||||
cursor++;
|
||||
}
|
||||
else if(*cursor == ARGLISTOPENSYM)
|
||||
{
|
||||
skip_arglist(&cursor);
|
||||
}
|
||||
else if(*cursor == ENUMLISTOPENSYM)
|
||||
{
|
||||
skip_enumlist(&cursor);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue