File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -373,25 +373,24 @@ var functionNode_webgl = (function() {
373373 ///
374374 /// @returns the prased openclgl string
375375 function ast_WhileStatement ( whileNode , retArr , funcParam ) {
376- throw ast_errorOutput (
377- "While statements are not allowed" ,
378- ast , funcParam
379- ) ;
380-
381- /*
382376 if ( whileNode . type != "WhileStatement" ) {
383377 throw ast_errorOutput (
384378 "Invalid while statment" ,
385379 ast , funcParam
386380 ) ;
387381 }
388- retArr.push("while (");
382+
383+ retArr . push ( "for (float i=0.0; i<LOOP_MAX; i++) {" ) ;
384+ retArr . push ( "if (" ) ;
389385 ast_generic ( whileNode . test , retArr , funcParam ) ;
390386 retArr . push ( ") {\n" ) ;
391387 ast_generic ( whileNode . body , retArr , funcParam ) ;
388+ retArr . push ( "} else {\n" ) ;
389+ retArr . push ( "break;\n" ) ;
392390 retArr . push ( "}\n" ) ;
391+ retArr . push ( "}\n" ) ;
392+
393393 return retArr ;
394- */
395394 }
396395
397396 function ast_AssignmentExpression ( assNode , retArr , funcParam ) {
You can’t perform that action at this time.
0 commit comments