diff options
author | 2015-10-12 10:12:00 +0900 | |
---|---|---|
committer | 2015-10-21 19:47:09 +0900 | |
commit | 97da02a5d432c8494518908c367c3979053bacca (patch) | |
tree | ffec4f9bfcd4f2f104f46aa7f9d62497ed79da7d /tools/generate-operator-out.py | |
parent | 6010fa93a61088aeb1f312c161f2c19de202a772 (diff) |
enum operator<<() script fails with do { } while cond;
The script assumes that a line containing a '}' and a ';' will only
and always signal the end of a scope.
Unfortunately, this also matches '} while (myCond);',
thus incorrectly thinking it has reached the end of a scope.
This can result in enums being emitted without scope resolution
(or with insufficient scope resolution), cause compile errors.
Change-Id: I6e1b3453b941bff93ddd0b2a9fd3950182668728
Signed-off-by: randy.jeong <randy.jeong@samsung.com>
Diffstat (limited to 'tools/generate-operator-out.py')
-rwxr-xr-x | tools/generate-operator-out.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/generate-operator-out.py b/tools/generate-operator-out.py index c74508d9cd..3bd62fe1db 100755 --- a/tools/generate-operator-out.py +++ b/tools/generate-operator-out.py @@ -86,8 +86,10 @@ def ProcessFile(filename): if m: enclosing_classes.append(m.group(1)) continue - m = re.compile(r'^\s*\}( .*)?;').search(raw_line) - if m: + + # End of class/struct -- be careful not to match "do { ... } while" constructs by accident + m = re.compile(r'^\s*\}(\s+)?(while)?(.+)?;').search(raw_line) + if m and not m.group(2): enclosing_classes = enclosing_classes[0:len(enclosing_classes) - 1] continue |