From 41e296599b5eb81494472cbdb6ec86746f682bcd Mon Sep 17 00:00:00 2001 From: "nkostylev@chromium.org" Date: Thu, 8 Aug 2013 11:35:18 +0000 Subject: 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 --- tools/idl_parser/idl_parser.py | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'tools/idl_parser/idl_parser.py') diff --git a/tools/idl_parser/idl_parser.py b/tools/idl_parser/idl_parser.py index 8a682ea..10428de 100755 --- a/tools/idl_parser/idl_parser.py +++ b/tools/idl_parser/idl_parser.py @@ -36,22 +36,8 @@ import time from idl_lexer import IDLLexer from idl_node import IDLAttribute, IDLNode -# -# Try to load the ply module, if not, then assume it is in the third_party -# directory. -# -try: - # Disable lint check which fails to find the ply module. - # pylint: disable=F0401 - from ply import lex - from ply import yacc -except ImportError: - module_path, module_name = os.path.split(__file__) - third_party = os.path.join(module_path, os.par, os.par, 'third_party') - sys.path.append(third_party) - # pylint: disable=F0401 - from ply import lex - from ply import yacc +from ply import lex +from ply import yacc # # ERROR_REMAP @@ -876,7 +862,7 @@ class IDLParser(object): def __init__(self, lexer, verbose=False, debug=False, mute_error=False): self.lexer = lexer self.tokens = lexer.KnownTokens() - self.yaccobj = yacc.yacc(module=self, tabmodule=None, debug=debug, + self.yaccobj = yacc.yacc(module=self, tabmodule=None, debug=False, optimize=0, write_tables=0) self.parse_debug = debug self.verbose = verbose @@ -987,8 +973,6 @@ class IDLParser(object): return IDLAttribute(key, Boolean(True)) def GetErrors(self): - # Access lexer errors, despite being private - # pylint: disable=W0212 return self._parse_errors + self.lexer._lex_errors # -- cgit v1.1