1
0
Fork 0
forked from len0rd/rockbox

Fixed another code generation bug with viewports and enabled negative numbers in tag parameters

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26465 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-06-02 06:52:17 +00:00
parent e25c903bfe
commit ea864be708
3 changed files with 6 additions and 5 deletions

View file

@ -97,9 +97,10 @@ QString ParseTreeNode::genCode() const
{ {
case VIEWPORT: case VIEWPORT:
if(children[0]->element->type == TAG)
buffer.append(TAGSYM);
buffer.append(children[0]->genCode()); buffer.append(children[0]->genCode());
if(!children[0]->isParam() if(children[0]->element->type == TAG)
&& children[0]->getElement()->type == TAG)
buffer.append('\n'); buffer.append('\n');
for(int i = 1; i < children.count(); i++) for(int i = 1; i < children.count(); i++)
buffer.append(children[i]->genCode()); buffer.append(children[i]->genCode());

View file

@ -481,7 +481,7 @@ int skin_parse_tag(struct skin_element* element, char** document)
element->params[i].type_code = *tag_args; element->params[i].type_code = *tag_args;
/* Checking a nullable argument for null */ /* Checking a nullable argument for null */
if(*cursor == DEFAULTSYM) if(*cursor == DEFAULTSYM && !isdigit(cursor[1]))
{ {
if(islower(*tag_args)) if(islower(*tag_args))
{ {
@ -497,7 +497,7 @@ int skin_parse_tag(struct skin_element* element, char** document)
else if(tolower(*tag_args) == 'i') else if(tolower(*tag_args) == 'i')
{ {
/* Scanning an int argument */ /* Scanning an int argument */
if(!isdigit(*cursor)) if(!isdigit(*cursor) && *cursor != '-')
{ {
skin_error(INT_EXPECTED); skin_error(INT_EXPECTED);
return 0; return 0;

View file

@ -107,7 +107,7 @@ int scan_int(char** document)
int retval; int retval;
int i; int i;
while(isdigit(*cursor) || *cursor == COMMENTSYM) while(isdigit(*cursor) || *cursor == COMMENTSYM || *cursor == '-')
{ {
if(*cursor == COMMENTSYM) if(*cursor == COMMENTSYM)
{ {