Module: wine Branch: master Commit: 778e98c19e53fcc6409798c3d46f45e9784617b8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=778e98c19e53fcc6409798c3d4...
Author: Matteo Bruni mbruni@codeweavers.com Date: Fri Sep 21 16:25:59 2012 +0200
d3dcompiler: Parse "for" loops with declarations.
---
dlls/d3dcompiler_43/hlsl.y | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 11764e5..88689f7 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1391,6 +1391,17 @@ loop_statement: KW_WHILE '(' expr ')' statement $$ = create_loop(LOOP_FOR, $4, $5, $6, $8, &loc); pop_scope(&hlsl_ctx); } + | KW_FOR '(' scope_start declaration expr_statement expr_statement ')' statement + { + struct source_location loc; + + set_location(&loc, &@1); + if (!$4) + hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_WARNING, + "no expressions in for loop initializer"); + $$ = create_loop(LOOP_FOR, $4, $5, $6, $8, &loc); + pop_scope(&hlsl_ctx); + }
expr_statement: ';' {