Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: testing/gmock/scripts/generator/cpp/ast.py

Issue 140003: Upgrade gtest to r267 and gmock to r173. (Closed)
Patch Set: final fileset. Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/gmock/scripts/generator/README ('k') | testing/gmock/scripts/generator/cpp/gmock_class.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/gmock/scripts/generator/cpp/ast.py
diff --git a/testing/gmock/scripts/generator/cpp/ast.py b/testing/gmock/scripts/generator/cpp/ast.py
index 6d1c8d3efc061949ee9a179434d79b7b653a53a4..47dc9a07daba611e059156d3aa586eaef4a757e1 100755
--- a/testing/gmock/scripts/generator/cpp/ast.py
+++ b/testing/gmock/scripts/generator/cpp/ast.py
@@ -782,7 +782,7 @@ class AstBuilder(object):
parts = self.converter.DeclarationToParts(temp_tokens, True)
(name, type_name, templated_types, modifiers, default,
unused_other_tokens) = parts
-
+
t0 = temp_tokens[0]
names = [t.name for t in temp_tokens]
if templated_types:
@@ -1551,18 +1551,22 @@ class AstBuilder(object):
token = self._GetNextToken()
self.namespace_stack.append(name)
assert token.token_type == tokenize.SYNTAX, token
+ # Create an internal token that denotes when the namespace is complete.
+ internal_token = tokenize.Token(_INTERNAL_TOKEN, _NAMESPACE_POP,
+ None, None)
+ internal_token.whence = token.whence
if token.name == '=':
# TODO(nnorwitz): handle aliasing namespaces.
name, next_token = self.GetName()
assert next_token.name == ';', next_token
+ self._AddBackToken(internal_token)
else:
assert token.name == '{', token
tokens = list(self.GetScope())
- del tokens[-1] # Remove trailing '}'.
+ # Replace the trailing } with the internal namespace pop token.
+ tokens[-1] = internal_token
# Handle namespace with nothing in it.
self._AddBackTokens(tokens)
- token = tokenize.Token(_INTERNAL_TOKEN, _NAMESPACE_POP, None, None)
- self._AddBackToken(token)
return None
def handle_using(self):
@@ -1672,7 +1676,7 @@ def PrintIndentifiers(filename, should_print):
if should_print(node):
print(node.name)
except KeyboardInterrupt:
- return
+ return
except:
pass
« no previous file with comments | « testing/gmock/scripts/generator/README ('k') | testing/gmock/scripts/generator/cpp/gmock_class.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698