changeset 9:3592b41928fe

Fixed: bindings were not generated
author Jacob Carlborg <doob@me.com>
date Thu, 09 Jul 2009 23:21:08 +0200
parents 2c0fd7bb4de6
children 27e00625790b
files scripts/dgen.rb
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/dgen.rb	Thu Jul 09 22:16:40 2009 +0200
+++ b/scripts/dgen.rb	Thu Jul 09 23:21:08 2009 +0200
@@ -309,8 +309,8 @@
 					file << copyright
 					file << "module #{mod};"
 					file << header.imports
-					file << "\n" unless @d_constants.length > 0 || @function_wrappers.length > 0
-					file << "import bindings = #{mod}_bindings".nl.nl(false) if @d_constants.length > 0 || @function_wrappers.length > 0
+					file << "\n" if header.d_constants.nil? || header.function_wrappers.nil?
+					file << "import bindings = #{mod}_bindings".nl.nl(false) unless header.d_constants.nil? || header.function_wrappers.nil?
 					file << header.defines
 					file << header.typedefs
 					file << header.cftypes
@@ -359,7 +359,7 @@
 					file << header.imports.nl(false)
 					file << header.constants
 					file << header.functions
-				end if @d_constants.length > 0 || @function_wrappers.length > 0	
+				end unless header.d_constants.nil? || header.function_wrappers.nil?
 			end
 		end
 		
@@ -376,8 +376,8 @@
 				file << copyright
 				file << "module #{mod};"
 				file << header.imports
-				file << "\n" unless @d_constants.length > 0 || @function_wrappers.length > 0
-				file << "import bindings = #{mod}_bindings".nl.nl(false) if @d_constants.length > 0 || @function_wrappers.length > 0
+				file << "\n" if header.d_constants.nil? || header.function_wrappers.nil?
+				file << "import bindings = #{mod}_bindings".nl.nl(false) unless header.d_constants.nil? || header.function_wrappers.nil?
 				file << header.defines
 				file << header.typedefs
 				file << header.cftypes
@@ -426,7 +426,7 @@
 				file << header.imports.nl(false)
 				file << header.constants
 				file << header.functions
-			end if @d_constants.length > 0 || @function_wrappers.length > 0					
+			end unless header.d_constants.nil? || header.function_wrappers.nil?				
 		end
 		
 		@classes.each do |clazz, value|
@@ -1069,6 +1069,7 @@
 			index = 0
 			declaration = build_function(method, true, static)[0 ... -2].indent.nl(false)
 			index = declaration.index_of(" ", index)
+			index = declaration.index_of(" ", index + 1) if static
 			str << ((declaration[0 .. index] + get_method_name(method["selector"]) + declaration[index .. -1]).gsub(/ +/, " "))[0 .. -2]
 			str << ";\n"
 		end
@@ -1196,6 +1197,7 @@
 	#
 	def get_type (type, type64, declared_type)
 		declared_type = "I" + $1 if declared_type =~ /\w+\s*<(.+)>/
+		declared_type.gsub!(/\(|\)/, "")
 				
 		return get_identifier(declared_type) if type.nil? && type64.nil?