Skip to content

Commit

Permalink
syncqt: Fix regexp capturing class names of partial specialisation
Browse files Browse the repository at this point in the history
Example with this code:
"template <class Key> struct QHashNode<Key, QHashDummyValue> {"

The previous regexp would take "QHashNode<Key," as some keyword,
and "QHashDummyValue>" as the class name.  By forbidding '<' in the
keyword, we avoid such mistake

Change-Id: I5d5077b9e5e764e91899bcaef137d99214ea5d63
Reviewed-by: Oswald Buddenhagen <[email protected]>
  • Loading branch information
ogoffart committed Jul 8, 2014
1 parent d376e95 commit 84e1895
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/syncqt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ sub classNames {
push @symbols, $1;
} elsif($definition =~ m/^ *typedef +(.*) +([^ ]*);$/) {
push @symbols, $2;
} elsif($definition =~ m/^ *(template *<.*> *)?(class|struct) +([^ ]* +)?((?!$post_kw)[^<\s]+) ?(<[^>]*> ?)?\s*(?:$post_kw)?\s*((,|:)\s*(public|protected|private) *.*)? *\{\}$/o) {
} elsif($definition =~ m/^ *(template *<.*> *)?(class|struct) +([^ <>]* +)?((?!$post_kw)[^<\s]+) ?(<[^>]*> ?)?\s*(?:$post_kw)?\s*((,|:)\s*(public|protected|private) *.*)? *\{\}$/o) {
push @symbols, $4;
} elsif($definition =~ m/^ *Q_DECLARE_.*ITERATOR\((.*)\);$/) {
push @symbols, "Q" . $1 . "Iterator";
Expand Down

0 comments on commit 84e1895

Please sign in to comment.