Bug 1155968 - Move statements to their own lines. r=khuey

This commit is contained in:
Boris Kudryavtsev 2015-05-05 17:24:00 +02:00
Родитель dc76fa3749
Коммит b24932ea8e
2 изменённых файлов: 18 добавлений и 9 удалений

Просмотреть файл

@ -206,7 +206,8 @@ def print_header(idl, fd, filename):
fd.write(header_end)
for p in idl.productions:
if p.kind == 'include': continue
if p.kind == 'include':
continue
if p.kind == 'cdata':
fd.write(p.data)
continue
@ -478,7 +479,8 @@ def write_interface(iface, fd):
fd.write(iface_template_prolog % names)
for member in iface.members:
if isinstance(member, xpidl.ConstMember) or isinstance(member, xpidl.CDATA): continue
if isinstance(member, xpidl.ConstMember) or isinstance(member, xpidl.CDATA):
continue
fd.write("/* %s */\n" % member.toIDL())
if isinstance(member, xpidl.Attribute):
fd.write(example_tmpl % {'implclass': implclass,

Просмотреть файл

@ -213,7 +213,8 @@ class NameMap(object):
object.name = object.name[1:]
if object.name in self._d:
old = self._d[object.name]
if old == object: return
if old == object:
return
if isinstance(old, Forward) and isinstance(object, Interface):
self._d[object.name] = object
elif isinstance(old, Interface) and isinstance(object, Forward):
@ -258,7 +259,8 @@ class Include(object):
yield os.path.join(dir, self.filename)
for file in incfiles():
if not os.path.exists(file): continue
if not os.path.exists(file):
continue
self.IDL = parent.parser.parse(open(file).read(), filename=file)
self.IDL.resolve(parent.incdirs, parent.parser)
@ -373,7 +375,8 @@ class Forward(object):
# forward.
if parent.hasName(self.name):
for i in xrange(0, len(parent.productions)):
if parent.productions[i] is self: break
if parent.productions[i] is self:
break
for i in xrange(i + 1, len(parent.productions)):
if hasattr(parent.productions[i], 'doccomments'):
parent.productions[i].doccomments[0:0] = self.doccomments
@ -796,7 +799,8 @@ class Attribute(object):
return "%s%sattribute %s %s;" % (attribs, readonly, self.type, self.name)
def isScriptable(self):
if not self.iface.attributes.scriptable: return False
if not self.iface.attributes.scriptable:
return False
return not self.noscript
def __str__(self):
@ -876,7 +880,8 @@ class Method(object):
raise IDLError("could not find is_size parameter '%s'" % p.size_is, self.location)
def isScriptable(self):
if not self.iface.attributes.scriptable: return False
if not self.iface.attributes.scriptable:
return False
return not (self.noscript or self.notxpcom)
def __str__(self):
@ -986,8 +991,10 @@ class Param(object):
def nativeType(self):
kwargs = {}
if self.shared: kwargs['shared'] = True
if self.const: kwargs['const'] = True
if self.shared:
kwargs['shared'] = True
if self.const:
kwargs['const'] = True
try:
return self.realtype.nativeType(self.paramtype, **kwargs)