Browse Source

Fixed .i non-generation of overridden standard methods. Fixes #181

woollybah 9 năm trước cách đây
mục cha
commit
dfd889319b
2 tập tin đã thay đổi với 20 bổ sung5 xóa
  1. 1 5
      ctranslator.bmx
  2. 19 0
      translator.bmx

+ 1 - 5
ctranslator.bmx

@@ -3568,7 +3568,6 @@ End Rem
 		' methods/funcs
 		'reserved = "New,Delete,ToString,ObjectCompare,SendMessage".ToLower()
 
-		
 		'For Local decl:TFuncDecl = EachIn classDecl.Decls()
 		For Local decl:TFuncDecl = EachIn fdecls
 
@@ -4277,14 +4276,11 @@ End Rem
 				Emit "-Delete()=" + Enquote("_" + classDecl.munged + "_Delete")
 			End If
 
-			'Local reserved:String = ",New,Delete,_reserved1_,_reserved2_,_reserved3_,".ToLower()
-
 			For Local decl:TDecl=EachIn classDecl.Decls()
 
 				Local fdecl:TFuncDecl=TFuncDecl( decl )
 				If fdecl
-
-					If Not equalsBuiltInFunc(classDecl, fdecl) Then
+					If Not equalsIfcBuiltInFunc(classDecl, fdecl) Then
 						EmitIfcClassFuncDecl fdecl
 					End If
 					Continue

+ 19 - 0
translator.bmx

@@ -280,6 +280,25 @@ Type TTranslator
 		Return False
 	End Method
 
+	Method equalsIfcBuiltInFunc:Int(classDecl:TClassDecl, func:TFuncDecl, checked:Int = False)
+		If checked Or func.IdentLower() = "new" Or func.IdentLower() = "delete" Then
+			If classDecl.munged = "bbObjectClass" Then
+				For Local decl:TFuncDecl = EachIn classDecl.Decls()
+					If Not decl.IsSemanted() Then
+						decl.Semant
+					End If
+					If decl.IdentLower() = func.IdentLower() Then
+						Return decl.EqualsFunc(func)
+					End If
+				Next
+			End If
+			If classDecl.superClass Then
+				Return equalsIfcBuiltInFunc(classDecl.superClass, func, True)
+			End If
+		End If
+		Return False
+	End Method
+
 	Method MungFuncDecl( fdecl:TFuncDecl )
 
 		If fdecl.munged Return