diff --git a/README.md b/README.md index 1d6f6b6a..33dae09b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ [![GitHub (pre-)release](https://img.shields.io/github/release/wufeifei/cobra/all.svg)](https://github.com/wufeifei/cobra/releases) [![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/wufeifei/cobra/blob/master/LICENSE) -当前版本非正式版本,正式版本正在做最后的内测中,建议等正式版本出来后再使用,敬请期待! [![asciicast](https://raw.githubusercontent.com/wufeifei/cobra/master/docs/report_03.jpg)](https://asciinema.org/a/132572) ## Introduction(介绍) diff --git a/cobra/parser.py b/cobra/parser.py index 7abd4b64..67dc55d4 100644 --- a/cobra/parser.py +++ b/cobra/parser.py @@ -119,6 +119,7 @@ def get_binaryop_params(node): # 当为BinaryOp类型时,分别对left和righ """ logger.debug('[AST] Binaryop --> {node}'.format(node=node)) params = [] + buffer_ = [] if isinstance(node.left, php.Variable) or isinstance(node.right, php.Variable): # left, right都为变量直接取值 if isinstance(node.left, php.Variable): @@ -133,6 +134,7 @@ def get_binaryop_params(node): # 当为BinaryOp类型时,分别对left和righ params = params_left + params_right + params = export_list(params, buffer_) return params @@ -178,6 +180,10 @@ def get_expr_name(node): # expr为'expr'中的值 param_lineno = node.lineno is_re = is_repair(node.name) # 调用了函数,判断调用的函数是否为修复函数 + elif isinstance(node, php.BinaryOp): # 当赋值表达式为BinaryOp + param_expr = get_binaryop_params(node) + param_lineno = node.lineno + else: param_expr = node