jscript: Added support for '-' CC expression.

This commit is contained in:
Jacek Caban 2014-10-01 10:45:44 +02:00 committed by Alexandre Julliard
parent fcd9817581
commit 9b41bb0345
2 changed files with 9 additions and 0 deletions

View File

@ -66,6 +66,7 @@ static int cc_parser_lex(void *lval, parser_ctx_t *ctx)
case '(':
case ')':
case '+':
case '-':
case '*':
case '/':
return *ctx->ptr++;
@ -105,6 +106,8 @@ CCAdditiveExpression
: CCMultiplicativeExpression { $$ = $1; }
| CCAdditiveExpression '+' CCMultiplicativeExpression
{ $$ = ccval_num(get_ccnum($1) + get_ccnum($3)); }
| CCAdditiveExpression '-' CCMultiplicativeExpression
{ $$ = ccval_num(get_ccnum($1) - get_ccnum($3)); }
CCMultiplicativeExpression
: CCUnaryExpression { $$ = $1; }

View File

@ -140,6 +140,12 @@ ok(@test === false, "@test = " + @test);
@set @test = (0 != true)
ok(@test === true, "@test = " + @test);
@set @test = (true-2)
ok(@test === -1, "@test = " + @test);
@set @test = (true-@_jscript)
ok(@test === 0, "@test = " + @test);
@if (false)
this wouldn not parse
"@end