diff options
author | hebert.christopherj@chromium.org <hebert.christopherj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-26 02:18:15 +0000 |
---|---|---|
committer | hebert.christopherj@chromium.org <hebert.christopherj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-26 02:18:15 +0000 |
commit | 3c6d186fa7157754045bcea6206a4e0109ad2e73 (patch) | |
tree | 5d0a7737f4d97f39680313f1b1c3b1d014dabdb2 /tools/json_schema_compiler/h_generator.py | |
parent | 38b3db9f0a4cce1f77b4bbd9b965338c8a8c349b (diff) | |
download | chromium_src-3c6d186fa7157754045bcea6206a4e0109ad2e73.zip chromium_src-3c6d186fa7157754045bcea6206a4e0109ad2e73.tar.gz chromium_src-3c6d186fa7157754045bcea6206a4e0109ad2e73.tar.bz2 |
JSON Schema Compiler supports functions as PropertyTypes.
Before, the compiler raised an exception when a function was used as a property,
which happens whenever a function is passed as a parameter.
The solution presented here is to create a bool has_<function_name> to allow
the hand-written C++ code to know whether or not the function was passed in.
BUG=138850
TEST=function_as_parameter
Review URL: https://chromiumcodereview.appspot.com/10824002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler/h_generator.py')
-rw-r--r-- | tools/json_schema_compiler/h_generator.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/json_schema_compiler/h_generator.py b/tools/json_schema_compiler/h_generator.py index ba7c5ca..4cc0e6f 100644 --- a/tools/json_schema_compiler/h_generator.py +++ b/tools/json_schema_compiler/h_generator.py @@ -158,10 +158,11 @@ class HGenerator(object): for prop in self._cpp_type_generator.ExpandParams(props): if prop.description: c.Comment(prop.description) - c.Append('%s %s;' % ( + (c.Append('%s %s;' % ( self._cpp_type_generator.GetType(prop, wrap_optional=True), prop.unix_name)) - c.Append() + .Append() + ) return c def _GenerateType(self, type_): |