⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181696 in webkit


Ignore:
Timestamp:
Mar 18, 2015, 9:27:07 AM (11 years ago)
Author:
mitz@apple.com
Message:

prepare-ChangeLog doesn't understand C string literals split across multiple lines with \
https://bugs.webkit.org/show_bug.cgi?id=142815

Reviewed by Darin Adler.

  • Scripts/prepare-ChangeLog:

(get_function_line_ranges_for_cpp): If the line ends with a backslash instead of a matching
quotation mark, use new variable $quotation_mark to remember what we are looking for, and
keep consuming the quoted text until the matching quotation mark is reached. Emit the
warning only if a line ends without a backslash before the matching quotation mark was found.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r181693 r181696  
     12015-03-18  Dan Bernstein  <mitz@apple.com>
     2
     3        prepare-ChangeLog doesn't understand C string literals split across multiple lines with \
     4        https://bugs.webkit.org/show_bug.cgi?id=142815
     5
     6        Reviewed by Darin Adler.
     7
     8        * Scripts/prepare-ChangeLog:
     9        (get_function_line_ranges_for_cpp): If the line ends with a backslash instead of a matching
     10        quotation mark, use new variable $quotation_mark to remember what we are looking for, and
     11        keep consuming the quoted text until the matching quotation mark is reached. Emit the
     12        warning only if a line ends without a backslash before the matching quotation mark was found.
     13
    1142015-03-18  Joseph Pecoraro  <pecoraro@apple.com>
    215
  • trunk/Tools/Scripts/prepare-ChangeLog

    r178686 r181696  
    698698    my $in_method_declaration = 0;
    699699    my $in_parentheses = 0;
     700    my $quotation_mark;
    700701    my $in_braces = 0;
    701702    my $in_toplevel_array_brace = 0;
     
    724725
    725726    while (<$file_handle>) {
     727        # Handle continued quoted string.
     728        if ($quotation_mark) {
     729            if (!s-([^\\]|\\.)*$quotation_mark--) {
     730                if (!m-\\$-) {
     731                    warn "mismatched quotes at line $. in $file_name\n";
     732                    undef $quotation_mark;
     733                }
     734                next;
     735            }
     736            undef $quotation_mark;
     737        }
     738
    726739        # Handle continued multi-line comment.
    727740        if ($in_comment) {
     
    754767            } else { # ' or "
    755768                if (!s-$match([^\\]|\\.)*?$match--) {
    756                     warn "mismatched quotes at line $. in $file_name\n";
    757                     s-$match.*--;
     769                    if (!s-$match.*\\$--) {
     770                        warn "mismatched quotes at line $. in $file_name\n";
     771                        s-$match.*--;
     772                    } else {
     773                        $quotation_mark = $match;
     774                    }
    758775                }
    759776            }
Note: See TracChangeset for help on using the changeset viewer.