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

Unified Diff: tools/json_schema_compiler/cpp_type_generator.py

Issue 9309044: Supporting more APIs with json_schema_compiler (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rework, add a couple of tests Created 8 years, 10 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 | « tools/json_schema_compiler/compiler.py ('k') | tools/json_schema_compiler/cpp_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cpp_type_generator.py
diff --git a/tools/json_schema_compiler/cpp_type_generator.py b/tools/json_schema_compiler/cpp_type_generator.py
index 34f3f16c51f3086427a49eccab94f7ce8de5350c..793ae136df301bb85e048ba16c9d3ffa238cd6f3 100644
--- a/tools/json_schema_compiler/cpp_type_generator.py
+++ b/tools/json_schema_compiler/cpp_type_generator.py
@@ -26,6 +26,9 @@ class CppTypeGenerator(object):
beneath the root namespace.
"""
for type_ in namespace.types:
+ if self._type_namespaces.get(type_, namespace) != namespace:
+ raise ValueError('Type %s is declared in both %s and %s' %
+ (type_, namespace.name, self._type_namespaces[type_].name))
self._type_namespaces[type_] = namespace
self._cpp_namespaces[namespace] = cpp_namespace
« no previous file with comments | « tools/json_schema_compiler/compiler.py ('k') | tools/json_schema_compiler/cpp_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698