Skip to content
Permalink
Browse files

Codegen indent fixes

  • Loading branch information
brunoabinader committed Dec 30, 2014
1 parent c950e3d commit 0721c624d9477fe3172d063b0463016e9f94e734
Showing with 5 additions and 5 deletions.
  1. +5 −5 components/script/dom/bindings/codegen/CodegenRust.py
@@ -103,7 +103,7 @@ class CastableObjectUnwrapper():
def __init__(self, descriptor, source, codeOnFailure):
self.substitution = {
"source": source,
"codeOnFailure": CGIndenter(CGGeneric(codeOnFailure), 4).define(),
"codeOnFailure": CGIndenter(CGGeneric(codeOnFailure), 8).define(),
}

def __str__(self):
@@ -1317,7 +1317,7 @@ class CGIndenter(CGThing):
A class that takes another CGThing and generates code that indents that
CGThing by some number of spaces. The default indent is two spaces.
"""
def __init__(self, child, indentLevel=2):
def __init__(self, child, indentLevel=4):
CGThing.__init__(self)
self.child = child
self.indent = " " * indentLevel
@@ -1778,7 +1778,7 @@ def _returnType(self):
def define(self):
body = self.definition_body()
if self.unsafe:
body = CGWrapper(body, pre="unsafe {\n", post="\n}")
body = CGWrapper(CGIndenter(body), pre="unsafe {\n", post="\n}")

return CGWrapper(CGIndenter(body),
pre=self.definition_prologue(),
@@ -4350,8 +4350,8 @@ def memberInit(memberInfo):
" }\n"
"}").substitute({
"selfName": self.makeClassName(d),
"initParent": CGIndenter(CGGeneric(initParent), indentLevel=6).define(),
"initMembers": CGIndenter(memberInits, indentLevel=6).define(),
"initParent": CGIndenter(CGGeneric(initParent), indentLevel=12).define(),
"initMembers": CGIndenter(memberInits, indentLevel=12).define(),
})

@staticmethod

0 comments on commit 0721c62

Please sign in to comment.
You can’t perform that action at this time.