The cpp parser of prepare-ChangeLog cannot detect a change in classes and namespaces
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 21:27:16 +0000 (21:27 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 21:27:16 +0000 (21:27 +0000)
commit600779db818f44c977c126fbe5a438329866deb6
tree4560dbf7b7f0991f355c09f8cace94a4ccc86b27
parent51edbaf0e971fe20c005881400c990a6d1ef765e
The cpp parser of prepare-ChangeLog cannot detect a change in classes and namespaces
https://bugs.webkit.org/show_bug.cgi?id=75531

Reviewed by David Kilzer.

Previously, the cpp parser of prepare-ChangeLog could not detect a change
outside methods. Consider the following cpp file.

    namespace N {
    int a;     // this change does not appear on ChangeLog.
    class C {
        int b;     // this change does not appear on ChangeLog.
        void f()
        {
            int c;     // this change appears on ChangeLog.
        }
        int d;     // this change does not appear on ChangeLog.
    };
    int e;     // this change does not appear on ChangeLog.
    };

The previous prepare-ChangeLog outputs just methods in which a change is found:
    (N::C::f):

This patch fixes prepare-ChangeLog so that it outputs namespaces, classes
and methods in which a change is found:
    (N):
    (N::C):
    (N::C::f):

* Scripts/prepare-ChangeLog:
(get_function_line_ranges_for_cpp): Modified as described above.

* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests.cpp: Added test cases.
(Class104):
(Class105):
(Class106):
(Class106::func32):
(Class106::func33):
(NameSpace3):
(NameSpace4):
(NameSpace5):
(NameSpace6):
(Class107):
(NameSpace5::NameSpace6::Class107::func34):
* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/prepare-ChangeLog
Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests-expected.txt
Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests.cpp