summaryrefslogtreecommitdiffstats
path: root/tools/idl_parser/idl_ppapi_lexer.py
diff options
context:
space:
mode:
authornkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-08 11:35:18 +0000
committernkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-08 11:35:18 +0000
commit41e296599b5eb81494472cbdb6ec86746f682bcd (patch)
treea2b6233e6ed633acbfc7814d5a65767d4e951e8c /tools/idl_parser/idl_ppapi_lexer.py
parent5311147515a6632dab64ba87962f51a790a4b194 (diff)
downloadchromium_src-41e296599b5eb81494472cbdb6ec86746f682bcd.zip
chromium_src-41e296599b5eb81494472cbdb6ec86746f682bcd.tar.gz
chromium_src-41e296599b5eb81494472cbdb6ec86746f682bcd.tar.bz2
Revert 216379 "IDL parser: fix lint errors and PPAPI ExtAttr gra..."
> IDL parser: fix lint errors and PPAPI ExtAttr grammar (+ test) > > This fixes Pylint errors in the IDL parser. > It also fixes the grammar for PPAPI-specific extended attributes, > and adds tests. > > Beyond beautification, this allows us to use Pylint in future > (skipping long line checks). > > Review URL: https://chromiumcodereview.appspot.com/22411002 TBR=nbarth@chromium.org Review URL: https://codereview.chromium.org/22681002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216380 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/idl_parser/idl_ppapi_lexer.py')
-rwxr-xr-xtools/idl_parser/idl_ppapi_lexer.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/tools/idl_parser/idl_ppapi_lexer.py b/tools/idl_parser/idl_ppapi_lexer.py
index 9e83486..2595f1c 100755
--- a/tools/idl_parser/idl_ppapi_lexer.py
+++ b/tools/idl_parser/idl_ppapi_lexer.py
@@ -15,25 +15,23 @@ PLY can be found at:
"""
from idl_lexer import IDLLexer
+import optparse
+import os.path
+import sys
#
# IDL PPAPI Lexer
#
class IDLPPAPILexer(IDLLexer):
- # Token definitions
- #
- # These need to be methods for lexer construction, despite not using self.
- # pylint: disable=R0201
-
# Special multi-character operators
def t_LSHIFT(self, t):
r'<<'
- return t
+ return t;
def t_RSHIFT(self, t):
r'>>'
- return t
+ return t;
def t_INLINE(self, t):
r'\#inline (.|\n)*?\#endinl.*'
@@ -47,15 +45,15 @@ class IDLPPAPILexer(IDLLexer):
self._AddKeywords(['label', 'struct'])
# Add number types
- self._AddKeywords(['char', 'int8_t', 'int16_t', 'int32_t', 'int64_t'])
- self._AddKeywords(['uint8_t', 'uint16_t', 'uint32_t', 'uint64_t'])
- self._AddKeywords(['double_t', 'float_t'])
+ self._AddKeywords(['char', 'int8_t', 'int16_t', 'int32_t', 'int64_t']);
+ self._AddKeywords(['uint8_t', 'uint16_t', 'uint32_t', 'uint64_t']);
+ self._AddKeywords(['double_t', 'float_t']);
# Add handle types
- self._AddKeywords(['handle_t', 'PP_FileHandle'])
+ self._AddKeywords(['handle_t', 'PP_FileHandle']);
# Add pointer types (void*, char*, const char*, const void*)
- self._AddKeywords(['mem_t', 'str_t', 'cstr_t', 'interface_t'])
+ self._AddKeywords(['mem_t', 'str_t', 'cstr_t', 'interface_t']);
# Remove JS types
self._DelKeywords(['boolean', 'byte', 'Date', 'DOMString', 'double',
@@ -67,4 +65,4 @@ if __name__ == '__main__':
lexer = IDLPPAPILexer()
lexer.Tokenize(open('test_parser/inline_ppapi.idl').read())
for tok in lexer.GetTokens():
- print '\n' + str(tok)
+ print '\n' + str(tok) \ No newline at end of file