Browse Source

Emit nested decls from localmain. Fixes #346.

woollybah 7 years ago
parent
commit
552921a035
1 changed files with 12 additions and 0 deletions
  1. 12 0
      ctranslator.bmx

+ 12 - 0
ctranslator.bmx

@@ -5721,6 +5721,18 @@ End If
 			EndIf
 			EndIf
 		Next
 		Next
 
 
+		' emit nested functions/classes for localmain
+		' emit nested protos
+		For Local fdecl:TFuncDecl = EachIn app.mainFunc._decls
+			EmitFuncDecl(fdecl, True)
+		Next
+		
+		' emit nested bodies
+		For Local fdecl:TFuncDecl = EachIn app.mainFunc._decls
+			EmitFuncDecl(fdecl, False)
+		Next
+
+
 		Emit "static int " + app.munged + "_inited" + " = 0;"
 		Emit "static int " + app.munged + "_inited" + " = 0;"
 
 
 		Emit "int " + app.munged + "(){"
 		Emit "int " + app.munged + "(){"