mirror of
https://github.com/holub/mame
synced 2025-05-22 13:48:55 +03:00
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:
parent
07388c4544
commit
de269aeb45
@ -1707,6 +1707,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, "<", " lt ");
|
||||||
|
|
||||||
|
astring_replacec(string, 0, " << ", " lshift ");
|
||||||
|
astring_replacec(string, 0, " <<", " lshift ");
|
||||||
|
astring_replacec(string, 0, "<< ", " lshift ");
|
||||||
|
astring_replacec(string, 0, "<<", " lshift ");
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_BOR, TIN_PRECEDENCE_10);
|
||||||
else if (strcmp(buffer, "bxor") == 0)
|
else if (strcmp(buffer, "bxor") == 0)
|
||||||
SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_BXOR, TIN_PRECEDENCE_9);
|
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 */
|
/* process anything else as a number or string */
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user