Bug 754244 - Prevent the XPIDL parser from tokenizing "long longValue" as "long long" "Value" by requiring that the next letter after a named identifier be a non-identifier letter, r?khuey
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 18 May 2012 12:42:01 -0400
changeset 98448 be715fe9c9164e5c4b519f567d6a96aa6127cfa7
parent 98447 2de348d84e83d4c717aee295977574247c52ef09
child 98449 6eb40a0f8e4cc3f8092e36f5e29645ad2851468a
push id1116
push userlsblakk@mozilla.com
push dateMon, 16 Jul 2012 19:38:18 +0000
treeherdermozilla-beta@95f959a8b4dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs754244
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 754244 - Prevent the XPIDL parser from tokenizing "long longValue" as "long long" "Value" by requiring that the next letter after a named identifier be a non-identifier letter, r?khuey
xpcom/idl-parser/xpidl.py
--- a/xpcom/idl-parser/xpidl.py
+++ b/xpcom/idl-parser/xpidl.py
@@ -1143,17 +1143,17 @@ class IDLParser(object):
     def t_singlelinecomment(self, t):
         r'(?m)//.*?$'
 
     def t_IID(self, t):
         return t
     t_IID.__doc__ = r'%(c)s{8}-%(c)s{4}-%(c)s{4}-%(c)s{4}-%(c)s{12}' % {'c': hexchar}
 
     def t_IDENTIFIER(self, t):
-        r'unsigned\ long\ long|unsigned\ short|unsigned\ long|long\ long|[A-Za-z][A-Za-z_0-9]*'
+        r'(unsigned\ long\ long|unsigned\ short|unsigned\ long|long\ long)(?![A-Za-z][A-Za-z_0-9])|[A-Za-z][A-Za-z_0-9]*'
         t.type = self.keywords.get(t.value, 'IDENTIFIER')
         return t
 
     def t_LCDATA(self, t):
         r'(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?'
         t.type = 'CDATA'
         t.value = t.lexer.lexmatch.group('cdata')
         t.lexer.lineno += t.value.count('\n')