瀏覽代碼

Emit nested decls from localmain. Fixes #346.

woollybah 7 年之前
父節點
當前提交
552921a035
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      ctranslator.bmx

+ 12 - 0
ctranslator.bmx

@@ -5721,6 +5721,18 @@ End If
 			EndIf
 		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 "int " + app.munged + "(){"