Chromium Code Reviews

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: Fixed minor style issues; added support for [nodart] IDL flag Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | tools/json_schema_compiler/compiler.py » ('j') | tools/json_schema_compiler/compiler.py » ('J')
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 07f657474472ea53fc459eae33df5bcff21cc85b..53fd0e42b1472386a1a906fc2052ae34553ebb72 100644
--- a/tools/json_schema_compiler/code.py
+++ b/tools/json_schema_compiler/code.py
@@ -63,6 +63,12 @@ class Code(object):
self._indent_level += self._indent_size
return self
+ def SblockBare(self):
not at google - send to devlin 2013/01/25 18:14:33 The nice thing about the other operations (with th
sashab 2013/01/29 08:27:13 Sure - I'm not going to change the default line ar
not at google - send to devlin 2013/01/29 16:37:08 Well, if Append didn't add a line given a blank ar
sashab 2013/02/04 05:09:27 Done.
+ """Starts a code block by increasing the indent, without adding a line.
+ """
+ self._indent_level += self._indent_size
+ return self
+
def Eblock(self, line=''):
"""Ends a code block by decreasing and then appending a line (or a blank
line if not given).
@@ -74,6 +80,12 @@ class Code(object):
self.Append(line)
return self
+ def EblockBare(self):
+ """Ends a code block by decreasing the indent, without adding a line.
+ """
+ self._indent_level -= self._indent_size
+ return self
+
def Comment(self, comment, comment_prefix='// '):
"""Adds the given string as a comment.
« no previous file with comments | « no previous file | tools/json_schema_compiler/compiler.py » ('j') | tools/json_schema_compiler/compiler.py » ('J')

Powered by Google App Engine