[webkit-reviews] review granted: [Bug 52272] check-webkit-style -- close_expression function doesn't work correctly. : [Attachment 78644] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 12 01:35:24 PST 2011


Shinichiro Hamaji <hamaji at chromium.org> has granted  review:
Bug 52272: check-webkit-style -- close_expression function doesn't work
correctly.
https://bugs.webkit.org/show_bug.cgi?id=52272

Attachment 78644: Patch
https://bugs.webkit.org/attachment.cgi?id=78644&action=review

------- Additional Comments from Shinichiro Hamaji <hamaji at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=78644&action=review

No, I was so sick and my brain stopped working when I told you that I couldn't
understand it. Now I feel better and I can understand this patch :) I'm sure
this code is good enough to land this as is. I put some nitpicks.

> Tools/Scripts/webkitpy/style/checkers/cpp.py:817
>	   end_character = ')'

How about creating the regexp string here?

if start_character == '(':
  enclosing_characeter_regexp = r'[\{\}]'
elif
  ...

> Tools/Scripts/webkitpy/style/checkers/cpp.py:829
> +    while True:

I think you used while because we start in the middle of the first line, but
I'd mildly prefer for-loop:

current_column = position.column + 1
net_open = 1
for line_number in xrange(position.row, len(elided):
  line = elided[line_number][current_column:]
  while True:
     ...
  current_column = 0
return Position(len(elided), -1)

because in this way we can clearly see the iterator of the outer loop.


More information about the webkit-reviews mailing list