[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebindings/kalyptus
From: Arno Rehn <kde () arnorehn ! de>
Date: 2008-06-29 0:17:38
Message-ID: 1214698658.156034.3787.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 825689 by arnorehn:
* Better resolve enum-types in templates.
Thanks to Andre Barboza for the bug report.
CCMAIL: kde-bindings@kde.org
M +1 -0 ChangeLog
M +39 -1 kalyptusDataDict.pm
--- trunk/KDE/kdebindings/kalyptus/ChangeLog #825688:825689
@@ -1,6 +1,7 @@
2008-06-28 Arno Rehn <arno@arnorehn.de>
* Resolve typedefs in kalyptus.
+ * Better resolve enum-types in templates. Thanks to Andre Barboza for the bug report.
2008-06-19 Arno Rehn <arno@arnorehn.de>
--- trunk/KDE/kdebindings/kalyptus/kalyptusDataDict.pm #825688:825689
@@ -2921,11 +2921,49 @@
my $tmpl = $2;
my $before = $`.$1;
my $after = $';
+ $before = resolveType( $before, $contextClass, $rootnode );
+ my $tmplNode = kdocAstUtil::findRef( $rootnode, $before );
+ my $tmplType;
+ my @tmplTypeList;
+ if ($tmplNode) {
+ $tmplType = $tmplNode->{Tmpl};
+ $tmplType =~ s/^template//;
+ $tmplType =~ s/^\s+//;
+ @tmplTypeList = kdocUtil::splitUnnested( ',', $tmplType );
+ for my $t(@tmplTypeList) {
+ $t =~ s/\s.*//;
+ }
+ }
my @args = kdocUtil::splitUnnested( ',', $tmpl);
grep s/^\s+//, @args;
grep s/\s+$//, @args;
+ my $i = 0;
for my $a(@args) {
- $a = resolveType( $a, $contextClass, $rootnode );
+ # ok, this gets tricky
+ # check if the template type is a class, struct or enum
+ if ($tmplTypeList[$i] eq 'class' || $tmplTypeList[$i] eq 'struct'
+ || $tmplTypeList[$i] eq 'enum' || $tmplTypeList[$i] eq 'typename'
+ || $tmplTypeList[$i] eq '')
+ {
+ $a = resolveType( $a, $contextClass, $rootnode );
+ } else {
+ # no, it's a typename
+ my $tmp = resolveType( $tmplTypeList[$i], $contextClass, $rootnode );
+ $tmp =~ s/\s*([\&\*]+)$// ? $1 : ''; # strip * and &
+ my $ref = kdocAstUtil::findRef( $rootnode, $tmp );
+ # for the moment we're only interested in enums
+ if ($ref && $ref->{NodeType} eq 'enum') {
+ if ($tmp =~ /::/) {
+ my @list = split('::', $tmp);
+ pop @list;
+ $tmp = join('::', @list);
+ }
+ $a = $tmp.'::'.$a;
+ } else {
+ $a = resolveType( $a, $contextClass, $rootnode );
+ }
+ }
+ $i++;
}
# normalize
$argType = $before."<".join( ", ", @args).">".$after;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic