Bug 1317180, part 2 - Remove really old ~ syntax error for MessageId in IPDL parser. r=billm draft
authorAndrew McCreight <continuation@gmail.com>
Sun, 13 Nov 2016 09:48:07 -0800
changeset 438679 377477b2c4750c1dd78e6a89f04680df15a352b1
parent 438678 8778a1d1c24f623cd8b5d1885f89bf22b670fad3
child 438680 0ca6c058e77ad67136eae8e95ad1e0327e7c63ce
push id35795
push userbmo:continuation@gmail.com
push dateMon, 14 Nov 2016 22:23:52 +0000
reviewersbillm
bugs1317180, 525342
milestone53.0a1
Bug 1317180, part 2 - Remove really old ~ syntax error for MessageId in IPDL parser. r=billm MessageId has the production "'~' ID", but if you use it, it produces an error. This error was added in 2009, in bug 525342. I doubt anybody expects it to work any more, so it should just be a regular parse error. This is the only usage of the literal ~ so it can now be removed from there. MozReview-Commit-ID: AivlLE8Nubv
ipc/ipdl/ipdl/parser.py
--- a/ipc/ipdl/ipdl/parser.py
+++ b/ipc/ipdl/ipdl/parser.py
@@ -153,17 +153,17 @@ reserved = set((
         'using',
         'verify'))
 tokens = [
     'COLONCOLON', 'ID', 'STRING',
 ] + [ r.upper() for r in reserved ]
 
 t_COLONCOLON = '::'
 
-literals = '(){}[]<>;:,~'
+literals = '(){}[]<>;:,'
 t_ignore = ' \f\t\v'
 
 def t_linecomment(t):
     r'//[^\n]*'
 
 def t_multilinecomment(t):
     r'/\*(\n|.)*?\*/'
     t.lexer.lineno += t.value.count('\n')
@@ -520,22 +520,19 @@ def p_MessageBody(p):
     msg.addOutParams(p[3])
     msg.addModifiers(p[4])
 
     p[0] = msg
 
 def p_MessageId(p):
     """MessageId : ID
                  | __DELETE__
-                 | DELETE
-                 | '~' ID"""
+                 | DELETE"""
     loc = locFromTok(p, 1)
-    if 3 == len(p):
-        _error(loc, "sorry, `%s()' destructor syntax is a relic from a bygone era.  Declare `__delete__()' in the `%s' protocol instead", p[1]+p[2], p[2])
-    elif 'delete' == p[1]:
+    if 'delete' == p[1]:
         _error(loc, "`delete' is a reserved identifier")
     p[0] = [ loc, p[1] ]
 
 def p_MessageInParams(p):
     """MessageInParams : '(' ParamList ')'"""
     p[0] = p[2]
 
 def p_MessageOutParams(p):