def visit_FunctionDef(self,node):
funcStart = node.lineno
funcEnd = node.body[len(node.body)-1].lineno
self.functions[node.name] = {'start':funcStart,'end':funcEnd}
#Grab the arguments
argList = node.args.args
for argNode in argList:
argName = argNode.arg
varObj = {'name':argName,'line':node.lineno,'start':node.lineno,'col':-1,'end':funcEnd,'is_arg':True}
self.varList.append(varObj)
ast.NodeVisitor.generic_visit(self, node)
评论列表
文章目录