bblfsh / python-driver

GNU General Public License v3.0
10 stars 16 forks source link

Variable redeclared #207

Open ncordon opened 5 years ago

ncordon commented 5 years ago

From the latest bblfsh logs we got this error:

key \"col_offset\": variable \"pos_start_exists\" redeclared (true vs false)

Files that produced the error:

components/specification/Xml/xsd-fu/trunk/generateDS/generateDS.py
components/xsd-fu/python/generateDS/generateDS.py
Demo/sgi/video/Vcopy.py
Demo/sgi/video/vcopy.py
components/xsd-fu/generateDS/generateDS.py
dennwc commented 4 years ago

Minimal reproducer:

global x, \
    y

From what I've seen, it seems that y token has the same line number and the position fixer fails to match it against the token map. The consequence is that the node corresponding to y has a line number, but no column or offset.

Next, ObjectToNode helper kicks in during the pre-process stage and causes the error message that we see.

So it might be a bug in both SDK (causing the error) and the driver (wrong positions).