Title: [105796] trunk/Tools
Revision
105796
Author
[email protected]
Date
2012-01-24 13:24:32 -0800 (Tue, 24 Jan 2012)

Log Message

prepare-ChangeLog outputs warnings for top-level { ... } blocks
https://bugs.webkit.org/show_bug.cgi?id=75943

Reviewed by David Kilzer.

Currently, prepare-ChangeLog outputs warnings for top-level { ... } blocks,
because it does not distinguish '}' at the end of a subroutine
with '}' at the end of a if or for statement.

foo.pl:
    if (1) {
    }
    for (@v) {
    }

output:
    nested functions found at top-level at foo.pl:2
    nested functions found at top-level at foo.pl:4

This patch fixes the bug.

* Scripts/prepare-ChangeLog:
(get_function_line_ranges_for_perl):
* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl:
Added test cases. No change in the test results.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (105795 => 105796)


--- trunk/Tools/ChangeLog	2012-01-24 21:23:13 UTC (rev 105795)
+++ trunk/Tools/ChangeLog	2012-01-24 21:24:32 UTC (rev 105796)
@@ -1,3 +1,31 @@
+2012-01-24  Kentaro Hara  <[email protected]>
+
+        prepare-ChangeLog outputs warnings for top-level { ... } blocks
+        https://bugs.webkit.org/show_bug.cgi?id=75943
+
+        Reviewed by David Kilzer.
+
+        Currently, prepare-ChangeLog outputs warnings for top-level { ... } blocks,
+        because it does not distinguish '}' at the end of a subroutine
+        with '}' at the end of a if or for statement.
+
+        foo.pl:
+            if (1) {
+            }
+            for (@v) {
+            }
+
+        output:
+            nested functions found at top-level at foo.pl:2
+            nested functions found at top-level at foo.pl:4
+
+        This patch fixes the bug.
+
+        * Scripts/prepare-ChangeLog:
+        (get_function_line_ranges_for_perl):
+        * Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl:
+        Added test cases. No change in the test results.
+
 2012-01-24  Dirk Pranke  <[email protected]>
 
         r105674 broke check-webkit-style for chromium's test_expectations.

Modified: trunk/Tools/Scripts/prepare-ChangeLog (105795 => 105796)


--- trunk/Tools/Scripts/prepare-ChangeLog	2012-01-24 21:23:13 UTC (rev 105795)
+++ trunk/Tools/Scripts/prepare-ChangeLog	2012-01-24 21:24:32 UTC (rev 105796)
@@ -1307,10 +1307,7 @@
                 $hereDocumentIdentifier = $1;
             }
             if (index($_, "}") == 0) {
-                unless ($start) {
-                    warn "nested functions found at top-level at $fileName:$.\n";
-                    next;
-                }
+                next unless $start;
                 push(@ranges, [$start, $., $currentFunction]);
                 $currentFunction = "";
                 $start = 0;

Modified: trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl (105795 => 105796)


--- trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl	2012-01-24 21:23:13 UTC (rev 105795)
+++ trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl	2012-01-24 21:24:32 UTC (rev 105796)
@@ -131,3 +131,13 @@
 sub prototypeDeclaration2();
 sub prototypeDeclaration3(\@$$);
 
+if (1) {
+}
+
+for (@array) {
+}
+
+{}
+
+{
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to