From 728db2150277206ae82d6f5ed82b86cf779ee653 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 17 Apr 2012 17:06:51 +0200 Subject: 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 --- lib/skin_parser/skin_scan.c | 71 +++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 51 deletions(-) (limited to 'lib/skin_parser/skin_scan.c') diff --git a/lib/skin_parser/skin_scan.c b/lib/skin_parser/skin_scan.c index f6424aba53..50d58bc250 100644 --- a/lib/skin_parser/skin_scan.c +++ b/lib/skin_parser/skin_scan.c @@ -28,7 +28,6 @@ #include "skin_debug.h" #include "symbols.h" #include "skin_parser.h" -#include "tag_table.h" /* Scanning Functions */ @@ -41,54 +40,6 @@ void skip_comment(const char** document) (*document)++; } -void skip_tag(const char** document) -{ - char tag_name[MAX_TAG_LENGTH]; - int i; - bool qmark; - const struct tag_info *tag; - const char *cursor; - - if(**document == TAGSYM) - (*document)++; - qmark = (**document == CONDITIONSYM); - if (qmark) - (*document)++; - - if (!qmark && find_escape_character(**document)) - { - (*document)++; - } - else - { - cursor = *document; - - /* Checking the tag name */ - for (i=0; cursor[i] && i 1) - { - tag_name[i-1] = '\0'; - tag = find_tag(tag_name); - i--; - } - - if (tag) - { - *document += strlen(tag->name); - } - } - if (**document == ARGLISTOPENSYM) - skip_arglist(document); - - if (**document == ENUMLISTOPENSYM) - skip_enumlist(document); -} - void skip_arglist(const char** document) { if(**document == ARGLISTOPENSYM) @@ -96,7 +47,16 @@ void skip_arglist(const char** document) while(**document && **document != ARGLISTCLOSESYM) { if(**document == TAGSYM) - skip_tag(document); + { + (*document)++; + if(**document == '\0') + break; + (*document)++; + } + else if(**document == ARGLISTOPENSYM) + skip_arglist(document); + else if(**document == ENUMLISTOPENSYM) + skip_enumlist(document); else if(**document == COMMENTSYM) skip_comment(document); else @@ -113,7 +73,16 @@ void skip_enumlist(const char** document) while(**document && **document != ENUMLISTCLOSESYM) { if(**document == TAGSYM) - skip_tag(document); + { + (*document)++; + if(**document == '\0') + break; + (*document)++; + } + else if(**document == ARGLISTOPENSYM) + skip_arglist(document); + else if(**document == ENUMLISTOPENSYM) + skip_enumlist(document); else if(**document == COMMENTSYM) skip_comment(document); else -- cgit v1.2.3