bblfsh / python-driver

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

Exception in variadic arguments #199

Closed chess-equality closed 4 years ago

chess-equality commented 5 years ago

I have the following functions:

def function6(a, *param):
    print "variadicArgs"
def function7(a, *args, **kwargs):
    print "variadicAndKeywordArgs"

Parsing these with the BblfshClient results in the following exception:

Vector(driver failure: Traceback (most recent call last):
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/requestprocessor.py", line 155, in process_request
    ast = AstImprover(code, orig_ast).parse()
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 39, in parse
    res = self.visit(self._astdict, root=True)
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 66, in visit
    visit_result = meth(node)
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 264, in visit_other
    node[field] = meth(child)
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 271, in visit_other_field
    return [self.visit(x) for x in node]
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 271, in <listcomp>
    return [self.visit(x) for x in node]
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 66, in visit
    visit_result = meth(node)
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 264, in visit_other
    node[field] = meth(child)
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 269, in visit_other_field
    return self.visit(node)
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 66, in visit
    visit_result = meth(node)
  File "/opt/driver/bin/.local/lib/python3.6/site-packages/python_driver/astimprove.py", line 242, in visit_arguments
    vararg["ast_type"] = "vararg"
TypeError: 'str' object does not support item assignment
)