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

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: Created 7 years, 11 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 | « 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):
+ """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
This is Rietveld 408576698