Bug 1317180, part 1 - Remove trailing whitespace from ast.py and parser.py. r=billm
MozReview-Commit-ID: IrQ7kiddrYO
--- a/ipc/ipdl/ipdl/ast.py
+++ b/ipc/ipdl/ipdl/ast.py
@@ -145,17 +145,17 @@ class Node:
if not hasattr(self, attrsName):
setattr(self, attrsName, _struct())
class NamespacedNode(Node):
def __init__(self, loc=Loc.NONE, name=None):
Node.__init__(self, loc)
self.name = name
- self.namespaces = [ ]
+ self.namespaces = [ ]
def addOuterNamespace(self, namespace):
self.namespaces.insert(0, namespace)
def qname(self):
return QualifiedId(self.loc, self.name,
[ ns.name for ns in self.namespaces ])
@@ -209,17 +209,17 @@ class UsingStmt(Node):
return self.kind == 'struct'
# "singletons"
class PrettyPrinted:
@classmethod
def __hash__(cls): return hash(cls.pretty)
@classmethod
def __str__(cls): return cls.pretty
-
+
class ASYNC(PrettyPrinted):
pretty = 'async'
class INTR(PrettyPrinted):
pretty = 'intr'
class SYNC(PrettyPrinted):
pretty = 'sync'
class INOUT(PrettyPrinted):
--- a/ipc/ipdl/ipdl/parser.py
+++ b/ipc/ipdl/ipdl/parser.py
@@ -252,17 +252,17 @@ def p_PreambleStmt(p):
def p_CxxIncludeStmt(p):
"""CxxIncludeStmt : INCLUDE STRING"""
p[0] = CxxInclude(locFromTok(p, 1), p[2])
def p_IncludeStmt(p):
"""IncludeStmt : INCLUDE PROTOCOL ID
| INCLUDE ID"""
loc = locFromTok(p, 1)
-
+
Parser.current.loc = loc
if 4 == len(p):
id = p[3]
type = 'protocol'
else:
id = p[2]
type = 'header'
inc = Include(loc, type, id)
@@ -605,17 +605,17 @@ def p_Transitions(p):
p[0] = [ p[1] ]
def p_Transition(p):
"""Transition : Trigger ID GOTO StateList ';'
| Trigger __DELETE__ ';'
| Trigger DELETE ';'"""
if 'delete' == p[2]:
_error(locFromTok(p, 1), "`delete' is a reserved identifier")
-
+
loc, trigger = p[1]
if 6 == len(p):
nextstates = p[4]
else:
nextstates = [ State.DEAD ]
p[0] = Transition(loc, trigger, p[2], nextstates)
def p_Trigger(p):
@@ -755,17 +755,17 @@ def p_ScalarType(p):
else:
loc, id = p[1]
p[0] = TypeSpec(loc, QualifiedId(loc, id))
def p_ActorType(p):
"""ActorType : ID ':' State"""
loc = locFromTok(p, 1)
p[0] = TypeSpec(loc, QualifiedId(loc, p[1]), state=p[3])
-
+
def p_MaybeNullable(p):
"""MaybeNullable : NULLABLE
| """
p[0] = (2 == len(p))
##--------------------
## C++ stuff
def p_CxxType(p):