Bug 49427

Summary: check-webkit-style function detection doesn't handle templates with spaces.
Product: WebKit Reporter: David Levin <levin>
Component: Tools / TestsAssignee: David Levin <levin>
Status: RESOLVED FIXED    
Severity: Normal CC: hamaji
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 49394    
Attachments:
Description Flags
Patch hamaji: review+, levin: commit-queue-

Description David Levin 2010-11-11 22:52:10 PST
See summary.
Comment 1 David Levin 2010-11-11 22:58:16 PST
Created attachment 73702 [details]
Patch
Comment 2 Shinichiro Hamaji 2010-11-11 23:07:43 PST
Comment on attachment 73702 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=73702&action=review

> WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py:2452
> +            ('my_namespace::my_other_namespace::MyVeryLongTypeName<Type1, Type5>*\n'

As now we can handle something like MyVeryLongTypeName<Type1, Type5<Type6, Type7> > , it's worth having such test case?
Comment 3 David Levin 2010-11-11 23:26:11 PST
Comment on attachment 73702 [details]
Patch

I'll change the test and commit.
Comment 4 David Levin 2010-11-11 23:33:40 PST
PS It found a bug.

I had to change
              line_with_no_templates = iteratively_replace_matches_with_char(r'<[^>]*>', line, "_")
to
               line_with_no_templates = iteratively_replace_matches_with_char(r'<[^<>]*>', line, "_")
in order not cover two templates at once (like this "< < >" which is what it was doing before).
Comment 5 Shinichiro Hamaji 2010-11-11 23:38:56 PST
(In reply to comment #4)
> PS It found a bug.
> 
> I had to change
>               line_with_no_templates = iteratively_replace_matches_with_char(r'<[^>]*>', line, "_")
> to
>                line_with_no_templates = iteratively_replace_matches_with_char(r'<[^<>]*>', line, "_")
> in order not cover two templates at once (like this "< < >" which is what it was doing before).

Ah, nice catch!
Comment 6 David Levin 2010-11-11 23:40:18 PST
Committed as http://trac.webkit.org/changeset/71896