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>
diff --git a/tools/generate-operator-out.py b/tools/generate-operator-out.py
index c74508d..3bd62fe 100755
--- a/tools/generate-operator-out.py
+++ b/tools/generate-operator-out.py
@@ -86,8 +86,10 @@
       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