diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-02-26 09:34:36 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-26 14:29:51 +0200 |
commit | d811b2434bd583a94a5e2b99808b8103768b1606 (patch) | |
tree | b5a4edcb7ac42519087037dd23f0ff4ff5ab10d3 /bin | |
parent | c09eeff2ab97111fc91b708bc8a9d981e4ccc990 (diff) |
syncqt: parse classes that use Q_DECL_FINAL|final|sealed
I've introduced a variable $post_kw (post-class-keywords) that
contains the patterns which are expected after a class name.
This variable is used both for a negative look-ahead assertion
in the class-name capture (so the regex doesn't parse the
keywords as the class-name), as well as to carry the parser
over the keywords into the subclass clauses.
Change-Id: Ia534ca01a511e1c773d007f1b0b4f448e8d009d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/syncqt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/syncqt b/bin/syncqt index fbeee2704a..5106d30f57 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -273,11 +273,12 @@ sub classNames { if($definition) { $definition =~ s=[\n\r]==g; my @symbols; + my $post_kw = qr/Q_DECL_FINAL|final|sealed/; # add here macros and keywords that go after the class-name of a class definition if($definition =~ m/^ *typedef *.*\(\*([^\)]*)\)\(.*\);$/) { push @symbols, $1; } elsif($definition =~ m/^ *typedef +(.*) +([^ ]*);$/) { push @symbols, $2; - } elsif($definition =~ m/^ *(template *<.*> *)?(class|struct) +([^ ]* +)?([^<\s]+) ?(<[^>]*> ?)?\s*((,|:)\s*(public|protected|private) *.*)? *\{\}$/) { + } 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"; |