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

Unified Diff: tools/json_schema_compiler/cpp_util.py

Issue 10022005: Let json schema compiler handle using arrays as types (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Small style changes Created 8 years, 8 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
Index: tools/json_schema_compiler/cpp_util.py
diff --git a/tools/json_schema_compiler/cpp_util.py b/tools/json_schema_compiler/cpp_util.py
index 0886826b7a99dd73bc5a505d49dce5200952cc65..9c9765c8bbf8cebb285b9457e9a320d6e5085e8a 100644
--- a/tools/json_schema_compiler/cpp_util.py
+++ b/tools/json_schema_compiler/cpp_util.py
@@ -45,7 +45,7 @@ def GetAsFundamentalValue(prop, src, dst):
PropertyType.DOUBLE: '%s->GetAsDouble(%s)',
}[prop.type_] % (src, dst)
-def GetValueType(prop):
+def GetValueType(type_):
"""Returns the Value::Type corresponding to the model.PropertyType.
"""
return {
@@ -54,10 +54,9 @@ def GetValueType(prop):
PropertyType.BOOLEAN: 'Value::TYPE_BOOLEAN',
PropertyType.DOUBLE: 'Value::TYPE_DOUBLE',
PropertyType.ENUM: 'Value::TYPE_STRING',
- PropertyType.REF: 'Value::TYPE_DICTIONARY',
PropertyType.OBJECT: 'Value::TYPE_DICTIONARY',
PropertyType.ARRAY: 'Value::TYPE_LIST',
- }[prop.type_]
+ }[type_]
def GetParameterDeclaration(param, type_):
"""Gets a parameter declaration of a given model.Property and its C++

Powered by Google App Engine
This is Rietveld 408576698