Sent: Monday, May 11, 2009 10:32 PM

To: submit@mamedev.org
Subject: LSHIFT/<< expression diff fix

Tafoid pointed out that it's currently impossible to use '<<' in a 
cheat xml file, this fix adds an alternate LSHIFT to cheat.c and
express.c and also adds the working '>>' as an alternate RSHIFT to 
express.c (not needed in cheat.c as >> parses fine)

diff file attached
This commit is contained in:
Aaron Giles 2009-05-15 05:29:09 +00:00
parent 07388c4544
commit de269aeb45
2 changed files with 9 additions and 0 deletions

View File

@ -1706,6 +1706,11 @@ static astring *quote_astring_expression(astring *string, int isattribute)
astring_replacec(string, 0, " <", " lt ");
astring_replacec(string, 0, "< ", " lt ");
astring_replacec(string, 0, "<", " lt ");
astring_replacec(string, 0, " << ", " lshift ");
astring_replacec(string, 0, " <<", " lshift ");
astring_replacec(string, 0, "<< ", " lshift ");
astring_replacec(string, 0, "<<", " lshift ");
return string;
}

View File

@ -887,6 +887,10 @@ static EXPRERR parse_string_into_tokens(const char *stringstart, parsed_expressi
SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_BOR, TIN_PRECEDENCE_10);
else if (strcmp(buffer, "bxor") == 0)
SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_BXOR, TIN_PRECEDENCE_9);
else if (strcmp(buffer, "lshift") == 0)
SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_LSHIFT, TIN_PRECEDENCE_5);
else if (strcmp(buffer, "rshift") == 0)
SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_RSHIFT, TIN_PRECEDENCE_5);
/* process anything else as a number or string */
else