File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,16 +185,21 @@ function renderStatements(statements, indentSize) {
185185 if ( statement . type === "if" ) {
186186 lines . push ( `${ indent } wf.doIf(/* ${ formatCondition ( statement . condition ) } */, ifBody -> {` ) ;
187187 lines . push ( ...renderStatements ( statement . then || [ ] , indentSize + 2 ) ) ;
188- lines . push ( `${ indent } }); ` ) ;
188+ lines . push ( `${ indent } })` ) ;
189189
190- for ( const branch of statement . elseIf || [ ] ) {
191- lines . push ( `${ indent } // else if ${ formatCondition ( branch . condition ) } (map to doElseIf)` ) ;
190+ const elseIfBranches = statement . elseIf || [ ] ;
191+ for ( const branch of elseIfBranches ) {
192+ lines . push ( `${ indent } .doElseIf(/* ${ formatCondition ( branch . condition ) } */, elseIfBody -> {` ) ;
192193 lines . push ( ...renderStatements ( branch . then || [ ] , indentSize + 2 ) ) ;
194+ lines . push ( `${ indent } })` ) ;
193195 }
194196
195197 if ( statement . else && ( statement . else . body || [ ] ) . length > 0 ) {
196- lines . push ( `${ indent } // else (map to doElse) ` ) ;
198+ lines . push ( `${ indent } .doElse(elseBody -> { ` ) ;
197199 lines . push ( ...renderStatements ( statement . else . body || [ ] , indentSize + 2 ) ) ;
200+ lines . push ( `${ indent } });` ) ;
201+ } else {
202+ lines . push ( `${ indent } ;` ) ;
198203 }
199204 continue ;
200205 }
You can’t perform that action at this time.
0 commit comments