|
PCART
v1.4
Automated Repair of Python API Parameter Compatibility Issues
|
Get all with nodes from a project source file 项目源码with节点遍历器 More...
Public Member Functions | |
| def | __init__ (self) |
| Initialize the withitem call dictionary 初始化withitem调用字典 More... | |
| def | get_withitem_call (self) |
| Return the withitem call dictionary 返回withitem调用字典 More... | |
| def | visit_AsyncWith (self, node) |
| Visit an AsyncWith node with the same alias resolution rules as With 访问AsyncWith节点,与With保持相同的别名还原规则 More... | |
| def | visit_With (self, node) |
| Visit a With node and record withitem context expressions 访问With节点,记录withitem上下文表达式 More... | |
| def | visit_withitem (self, node) |
| Visit a standalone withitem node (top-level visitor entry) 访问独立的withitem节点 More... | |
Get all with nodes from a project source file 项目源码with节点遍历器
For a withitem node, extract the call name in the context_expr and its alias name (if any) in the optional_vars 对于withitem节点,提取其中的call节点和别名(如果有)
Definition at line 122 of file extractCall.py.
| def __init__ | ( | self | ) |
Initialize the withitem call dictionary 初始化withitem调用字典
同名with别名可能在不同作用域重复出现,因此按别名保存所有候选及其行号范围
Definition at line 127 of file extractCall.py.
| def get_withitem_call | ( | self | ) |
Return the withitem call dictionary 返回withitem调用字典
Definition at line 133 of file extractCall.py.
| def visit_AsyncWith | ( | self, | |
| node | |||
| ) |
Visit an AsyncWith node with the same alias resolution rules as With 访问AsyncWith节点,与With保持相同的别名还原规则
| node | The AsyncWith AST node |
Definition at line 151 of file extractCall.py.
| def visit_With | ( | self, | |
| node | |||
| ) |
Visit a With node and record withitem context expressions 访问With节点,记录withitem上下文表达式
手动遍历body,避免generic_visit再次访问withitem导致重复记录
| node | The With AST node |
Definition at line 142 of file extractCall.py.
| def visit_withitem | ( | self, | |
| node | |||
| ) |
Visit a standalone withitem node (top-level visitor entry) 访问独立的withitem节点
| node | The withitem AST node |
Definition at line 168 of file extractCall.py.