Remove complicated merging of used names from the parser.

It's a lot of complicated code and a lot can go wrong. It also didn't speed up anything. If anything it made things like 5% slower. I have tested this with:

./scripts/diff_parser_profile.py wx._core.py

wx._core.py is not part of Jedi.
This commit is contained in:
Dave Halter
2017-03-16 22:00:01 +01:00
parent ce41119051
commit 519fa9cfb5
2 changed files with 7 additions and 27 deletions

View File

@@ -26,6 +26,8 @@ import jedi
def run(parser, lines):
diff_parser = DiffParser(parser)
diff_parser.update(lines)
# Make sure used_names is loaded
parser.module.used_names
def main(args):
@@ -36,6 +38,8 @@ def main(args):
code = f.read()
grammar = load_grammar()
parser = ParserWithRecovery(grammar, u(code))
# Make sure used_names is loaded
parser.module.used_names
code = code + '\na\n' # Add something so the diff parser needs to run.
lines = splitlines(code, keepends=True)