Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #529 from BlBana/origin/develop
Browse files Browse the repository at this point in the history
Optimize the code
  • Loading branch information
FeeiCN authored Sep 4, 2017
2 parents 0dc5e50 + 323a738 commit e0287cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cobra/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -133,6 +134,7 @@ def get_binaryop_params(node): # 当为BinaryOp类型时,分别对left和righ

params = params_left + params_right

params = export_list(params, buffer_)
return params


Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e0287cb

Please sign in to comment.