diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2012-02-01 21:53:31 +1100 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2012-02-01 22:05:06 +1100 |
commit | f417312a71064550cf66bbbec41f1e18d38b74f2 (patch) | |
tree | 422d94b09764cfa80a3500c0dbd091e4efc50968 /lib/skin_parser | |
parent | 5f387c28ce716cb6991c36dd9a1e77069066f0ea (diff) | |
download | rockbox-f417312a71064550cf66bbbec41f1e18d38b74f2.tar.gz rockbox-f417312a71064550cf66bbbec41f1e18d38b74f2.zip |
skin parser: Allow the first character after conditional seperators to be \n
This hopefully makes difficult conditionals more easy to read: i.e
OLD: %?bp<%?bc<%xd(Ba)|%xd(Bb)>|%?bl<|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bh)|%xd(Bi)|%xd(Bj)>>
NEW:
%?bp<
%?bc<
%xd(Ba)|%xd(Bb)
>|
%?bl<|%xd(Bc)|%xd(Bd)|
%xd(Be)|%xd(Bf)|
%xd(Bg)|%xd(Bh)|
%xd(Bi)|%xd(Bj)
>
>
Change-Id: Ic89d2c95562b27e7427c3a5d528340f9aec55cf2
Diffstat (limited to 'lib/skin_parser')
-rw-r--r-- | lib/skin_parser/skin_parser.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c index 7dc0fa3a2f..24f64fd788 100644 --- a/lib/skin_parser/skin_parser.c +++ b/lib/skin_parser/skin_parser.c @@ -961,7 +961,7 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc return 0; } bookmark = cursor; - while(*cursor != ENUMLISTCLOSESYM && *cursor != '\n' && *cursor != '\0') + while(*cursor != ENUMLISTCLOSESYM && *cursor != '\0') { if(*cursor == COMMENTSYM) { @@ -969,6 +969,8 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc } else if(*cursor == ENUMLISTOPENSYM) { + if (*cursor == '\n') + cursor++; skip_enumlist(&cursor); } else if(*cursor == TAGSYM) @@ -982,6 +984,8 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc { children++; cursor++; + if (*cursor == '\n') + cursor++; #ifdef ROCKBOX if (false_branch == NULL && !feature_available) { @@ -1038,6 +1042,11 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc for(i = 0; i < children; i++) { + if (*cursor == '\n') + { + skin_line++; + cursor++; + } children_array[i] = skin_buffer_to_offset(skin_parse_code_as_arg(&cursor)); if (children_array[i] < 0) return 0; |