Commit e7b8459b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added support for relational CC expressions.

parent d9e8c013
......@@ -192,13 +192,13 @@ CCEqualityExpression
CCRelationalExpression
: CCShiftExpression { $$ = $1; }
| CCRelationalExpression '<' CCShiftExpression
{ FIXME("'<' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
{ $$ = ccval_bool(get_ccnum($1) < get_ccnum($3)); }
| CCRelationalExpression tLEQ CCShiftExpression
{ FIXME("'<=' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
{ $$ = ccval_bool(get_ccnum($1) <= get_ccnum($3)); }
| CCRelationalExpression '>' CCShiftExpression
{ FIXME("'>' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
{ $$ = ccval_bool(get_ccnum($1) > get_ccnum($3)); }
| CCRelationalExpression tGEQ CCShiftExpression
{ FIXME("'>=' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
{ $$ = ccval_bool(get_ccnum($1) >= get_ccnum($3)); }
CCShiftExpression
: CCAdditiveExpression { $$ = $1; }
......
......@@ -152,8 +152,33 @@ ok(@test === true, "@test = " + @test);
@set @test = (1==false+1)
ok(@test === true, "@test = " + @test);
@set @test = (1+true==false+1)
ok(@test === false, "@test = " + @test);
function expect(val, exval) {
ok(val === exval, "got " + val + " expected " + exval);
}
@set @test = (false < 0.5)
expect(@test, true);
@set @test = (true == 0 < 0.5)
expect(@test, true);
@set @test = (false < 0)
expect(@test, false);
@set @test = (false > 0.5)
expect(@test, false);
@set @test = (1 < true)
expect(@test, false);
@set @test = (1 <= true)
expect(@test, true);
@set @test = (1 >= true)
expect(@test, true);
@set @test = (1 >= true-1)
expect(@test, true);
@if (false)
this wouldn not parse
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment