Browse Source

Fixed tolua outside function name.

aster2013 12 years ago
parent
commit
2e9b720f4a
1 changed files with 9 additions and 6 deletions
  1. 9 6
      Source/Engine/LuaScript/pkgs/ToDoxHook.lua

+ 9 - 6
Source/Engine/LuaScript/pkgs/ToDoxHook.lua

@@ -69,7 +69,7 @@ function classEnumerate:print(ident,close)
   end
   end
 end
 end
 
 
-function printFunction(self,ident,close)
+function printFunction(self,ident,close,isfunc)
   local func = {}
   local func = {}
   func.mod  = self.mod
   func.mod  = self.mod
   func.type = self.type
   func.type = self.type
@@ -80,6 +80,10 @@ function printFunction(self,ident,close)
   func.cname = self.cname
   func.cname = self.cname
   func.lname = self.lname
   func.lname = self.lname
 
 
+  if isfunc then
+    func.name = func.lname
+  end
+
   currentFunction = func
   currentFunction = func
   local i = 1
   local i = 1
   while self.args[i] do
   while self.args[i] do
@@ -108,11 +112,11 @@ function printFunction(self,ident,close)
 end
 end
 
 
 function classFunction:print(ident,close)
 function classFunction:print(ident,close)
-  printFunction(self,ident,close)
+  printFunction(self,ident,close, true)
 end
 end
 
 
 function classOperator:print(ident,close)
 function classOperator:print(ident,close)
-  printFunction(self,ident,close)
+  printFunction(self,ident,close, false)
 end
 end
 
 
 function classVariable:print(ident,close)
 function classVariable:print(ident,close)
@@ -120,10 +124,10 @@ function classVariable:print(ident,close)
   property.mod  = self.mod
   property.mod  = self.mod
   property.type = self.type
   property.type = self.type
   property.ptr  = self.ptr
   property.ptr  = self.ptr
-  property.name = self.name
+  property.name = self.lname
   property.def  = self.def
   property.def  = self.def
   property.ret  = self.ret
   property.ret  = self.ret
-
+  
   if currentClass == nil then
   if currentClass == nil then
     if property.mod:find("tolua_property__") == nil then
     if property.mod:find("tolua_property__") == nil then
       table.insert(globalConstants, property)
       table.insert(globalConstants, property)
@@ -271,7 +275,6 @@ function writeGLobalProperties(file)
 end
 end
 
 
 function writeProperty(file, property)
 function writeProperty(file, property)
-  property.name = property.name:gsub("_", "")
   file:write("- " .. property.type .. property.ptr .. " " .. property.name)
   file:write("- " .. property.type .. property.ptr .. " " .. property.name)
   if property.mod:find("tolua_readonly") == nil then
   if property.mod:find("tolua_readonly") == nil then
     file:write("\n")
     file:write("\n")