Bug 155273

Summary: check-webkit-style: fix false-positive warnings about @try/@catch blocks in Objective-C++ source files
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Tools / TestsAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, bfulgham, commit-queue, darin, dbates, ddkilzer, glenn, lforschler, thorton
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch v2 none

Description David Kilzer (:ddkilzer) 2016-03-09 15:50:29 PST
The check-webkit-style script emits false-positive warnings about @try/@catch blocks in Objective-C++ source files.

See Bug 155258 Comment #3.
<https://bugs.webkit.org/show_bug.cgi?id=155258#c3>
Comment 1 David Kilzer (:ddkilzer) 2016-03-09 15:55:24 PST
Created attachment 273497 [details]
Patch
Comment 2 David Kilzer (:ddkilzer) 2016-03-09 15:56:29 PST
Comment on attachment 273497 [details]
Patch

Oops, I see a problem with one of the regexes.
Comment 3 David Kilzer (:ddkilzer) 2016-03-09 16:00:25 PST
Created attachment 273500 [details]
Patch v2
Comment 4 WebKit Commit Bot 2016-03-09 17:53:31 PST
Comment on attachment 273500 [details]
Patch v2

Clearing flags on attachment: 273500

Committed r197912: <http://trac.webkit.org/changeset/197912>
Comment 5 WebKit Commit Bot 2016-03-09 17:53:35 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 David Kilzer (:ddkilzer) 2016-03-10 17:28:37 PST
Comment on attachment 273500 [details]
Patch v2

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

> Tools/Scripts/webkitpy/style/checkers/cpp.py:2429
> -          and not search(r'\b(if|for|while|switch|NS_ENUM)\b', line)
> +          and not search(r'(\b(if|for|while|switch|NS_ENUM)|} @catch)\b', line)

For posterity r'(\b(if|for|while|switch|NS_ENUM|@catch)\b' doesn't work because the pattern '\b@catch\b' doesn't match '} @catch (NSException *exception){\n', presumably since '@' is not considered the start of a word.