Adapt class decl regexp to match V8's decorators

This also allows digits in class decorators, to also match macros like
V8_EXPORT_PRIVATE.
This commit is contained in:
Clemens Hammacher 2018-12-07 16:19:36 +01:00
parent 6271f3f473
commit 98f4c45411

2
cpplint/cpplint.py vendored
View File

@ -2653,7 +2653,7 @@ class NestingState(object):
# };
class_decl_match = Match(
r'^(\s*(?:template\s*<[\w\s<>,:]*>\s*)?'
r'(class|struct)\s+(?:[A-Z_]+\s+)*(\w+(?:::\w+)*))'
r'(class|struct)\s+(?:[A-Z0-9_]+\s+)*(\w+(?:::\w+)*))'
r'(.*)$', line)
if (class_decl_match and
(not self.stack or self.stack[-1].open_parentheses == 0)):