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

Unified Diff: tools/json_schema_compiler/code.py

Issue 12041098: Initial commit of the Dart Chrome Extension APIs generators (Closed) Base URL: http://git.chromium.org/chromium/src.git@file_path_bugfix
Patch Set: Kalman fixes 2 (nocompile ignored in bundle mode) Created 7 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/cc_generator.py ('k') | tools/json_schema_compiler/compiler.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/code.py
diff --git a/tools/json_schema_compiler/code.py b/tools/json_schema_compiler/code.py
index 009eb12f16953c80616f29ab3d9d3d8df374ac58..a0a2a5fab6dd23af92b6aa08029a44a9659d3e10 100644
--- a/tools/json_schema_compiler/code.py
+++ b/tools/json_schema_compiler/code.py
@@ -63,16 +63,17 @@ class Code(object):
self.Concat(code).Append()
return self
- def Sblock(self, line=''):
+ def Sblock(self, line=None):
"""Starts a code block.
Appends a line of code and then increases the indent level.
"""
- self.Append(line)
+ if line is not None:
+ self.Append(line)
self._indent_level += self._indent_size
return self
- def Eblock(self, line=''):
+ def Eblock(self, line=None):
"""Ends a code block by decreasing and then appending a line (or a blank
line if not given).
"""
@@ -80,7 +81,8 @@ class Code(object):
#if not isinstance(line, basestring):
# raise TypeError
self._indent_level -= self._indent_size
- self.Append(line)
+ if line is not None:
+ self.Append(line)
return self
def Comment(self, comment, comment_prefix='// '):
« no previous file with comments | « tools/json_schema_compiler/cc_generator.py ('k') | tools/json_schema_compiler/compiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698