Bug 155273 - check-webkit-style: fix false-positive warnings about @try/@catch blocks in Objective-C++ source files
Summary: check-webkit-style: fix false-positive warnings about @try/@catch blocks in O...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-09 15:50 PST by David Kilzer (:ddkilzer)
Modified: 2016-03-10 17:28 PST (History)
9 users (show)

See Also:


Attachments
Patch (3.05 KB, patch)
2016-03-09 15:55 PST, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v2 (3.06 KB, patch)
2016-03-09 16:00 PST, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.