# HG changeset patch # User Jacob Carlborg # Date 1247170600 -7200 # Node ID 2c0fd7bb4de6e2158fa5014fcceaef8fc32e46ed # Parent 9e67a1122e8506f0fe63b5e6d22e9c559f2c4d8c Added a T in front of every template. Added support for interfaces as method parameters diff -r 9e67a1122e85 -r 2c0fd7bb4de6 dsss.conf --- a/dsss.conf Thu Jul 09 21:17:39 2009 +0200 +++ b/dsss.conf Thu Jul 09 22:16:40 2009 +0200 @@ -1,2 +1,3 @@ -[main.d] -exlude += dstep/Cocoa \ No newline at end of file +[dstep] +exlude += dstep/foundation +exlude += dstep/appkit \ No newline at end of file diff -r 9e67a1122e85 -r 2c0fd7bb4de6 scripts/dgen.rb --- a/scripts/dgen.rb Thu Jul 09 21:17:39 2009 +0200 +++ b/scripts/dgen.rb Thu Jul 09 22:16:40 2009 +0200 @@ -544,7 +544,7 @@ str << "mixin ObjcWrap".indent.nl templates_for_class(clazz.name).each do |template, value| - str << "mixin #{template}".indent.nl + str << "mixin #{get_identifier("T" + template)}".indent.nl end str << "\n" @@ -577,12 +577,12 @@ interfaces.each do |interface| str = StringIO.new - str << "interface I" # prepend I to the interface name, because it can be the same as a class name + str << "interface " # prepend I to the interface name, because it can be the same as a class name if interface == "" - str << get_identifier(interface.name).nl(false) + str << get_identifier("I" + interface.name).nl(false) else - str << get_identifier(interface.name) + str << get_identifier("I" + interface.name) unless interface.parent == "" str << " : " @@ -629,7 +629,7 @@ str = StringIO.new str << "template " - str << get_identifier(template.name) + str << get_identifier("T" + template.name) str << " ()".nl(false) str << "{".nl(false) str << interface_methods(template.method, template.name) if template["class"] == "NSObject" @@ -1042,7 +1042,7 @@ end method.arg.each_with_index do |arg, i| - str << arg.name + str << get_identifier(arg.name) str << ", " unless i == method.arg.length - 1 end unless method.arg.nil? @@ -1195,7 +1195,8 @@ # get_type("I", "I", "unsigned int") #=> uint # def get_type (type, type64, declared_type) - + declared_type = "I" + $1 if declared_type =~ /\w+\s*<(.+)>/ + return get_identifier(declared_type) if type.nil? && type64.nil? t = check_declared_type(declared_type)