2
0
Mark Sibly 7 жил өмнө
parent
commit
cb033f7726

+ 17 - 2
src/mx2cc/geninfo/geninfo.monkey2

@@ -272,14 +272,29 @@ Class GeninfoGenerator
 	Method GenNode:JsonValue( forStmt:ForStmtExpr )
 		
 		Local jobj:=MakeNode( forStmt,"block" )
+		
 '		jobj.SetValue( "stmts",GenNode( forStmt.stmts ) )
+
 		Local jarr:=New JsonArray
+		
 		If forStmt.semVar jarr.Add( GenNode( forStmt.semVar.vdecl ) )
+
 		For Local stmt:=Eachin forStmt.stmts
-			Local jobj:=GenNode( stmt )
-			If jobj jarr.Add( GenNode( stmt ) )
+			Local jval:=GenNode( stmt )
+			If Not jval Continue
+			
+			Local jarr2:=Cast<JsonArray>( jval )
+			If jarr2 
+				For Local jval:=Eachin jarr2
+					jarr.Add( jval )
+				Next
+				Continue
+			Endif
+			jarr.Add( jval )
 		Next
+		
 		jobj.SetValue( "stmts",jarr )
+		
 		Return jobj
 	End