From d811b2434bd583a94a5e2b99808b8103768b1606 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 26 Feb 2012 09:34:36 +0100 Subject: [PATCH] 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 --- bin/syncqt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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";