Chromium Code Reviews| Index: Source/bindings/scripts/blink_idl_parser.py |
| diff --git a/Source/bindings/scripts/blink_idl_parser.py b/Source/bindings/scripts/blink_idl_parser.py |
| index 6b205f2421c0c3f18ac2d51bad1fdce7988fe697..0962e4ce715d7101a8df612b45483f518fe3cf74 100644 |
| --- a/Source/bindings/scripts/blink_idl_parser.py |
| +++ b/Source/bindings/scripts/blink_idl_parser.py |
| @@ -380,6 +380,8 @@ class BlinkIDLParser(IDLParser): |
| def __init__(self, |
| # common parameters |
| debug=False, |
| + # local parameters |
| + rewrite_tables=False, |
| # idl_parser parameters |
| lexer=None, verbose=False, mute_error=False, |
| # yacc parameters |
| @@ -394,6 +396,11 @@ class BlinkIDLParser(IDLParser): |
| write_tables = True |
| if outputdir: |
| picklefile = picklefile or os.path.join(outputdir, 'parsetab.pickle') |
| + if rewrite_tables: |
| + try: |
| + os.unlink(picklefile) |
| + except OSError: |
| + pass |
| lexer = lexer or BlinkIDLLexer(debug=debug, |
| outputdir=outputdir, |
| @@ -439,7 +446,7 @@ def main(argv): |
| except IndexError as err: |
| print 'Usage: %s OUTPUT_DIR' % argv[0] |
| return 1 |
| - parser = BlinkIDLParser(outputdir=outputdir) |
| + parser = BlinkIDLParser(outputdir=outputdir, rewrite_tables=True) |
|
Nils Barth (inactive)
2014/06/23 11:05:14
Could you add a comment here explaining why this i
|
| if __name__ == '__main__': |