kamahen / pykythe

Generate code Python source cross-reference facts in Kythe format
Other
21 stars 3 forks source link

Local variables aren't collected properly #1

Closed kamahen closed 6 years ago

kamahen commented 6 years ago

In pykythe/test_data/py3_test_grammar.py, if test_main is changed as follows:

def test_main():
    #- @TokenTests ref T?
    run_unittest(TokenTests, GrammarTests)

then verifier outputs the following, which is wrong:

T: EVar(0x00000000022b4900 = App(vname, (test_data.py3_test_grammar.test_main.<local>.TokenTests, test-corpus, test-root, "", python)))

The problem is that processing for a funcdef (and also classdef) doesn't first do a pass for all the "bindings" inside it.

kamahen commented 6 years ago

The code for looking up names was completely missing. This has been fixed in Fix name lookups + reorder classes in kythe.py