def p_call_expr_nobf(self, p): """call_expr_nobf : member_expr_nobf arguments | call_expr_nobf arguments | call_expr_nobf LBRACKET expr RBRACKET | call_expr_nobf PERIOD identifier """ if len(p) == 3: p[0] = ast.FunctionCall(p[1], p[2]) elif len(p) == 4: p[0] = ast.DotAccessor(p[1], p[3]) else: p[0] = ast.BracketAccessor(p[1], p[3])
def p_call_expr_nobf(self, p): """call_expr_nobf : member_expr_nobf arguments | call_expr_nobf arguments | call_expr_nobf LBRACKET expr RBRACKET | call_expr_nobf PERIOD identifier | call_expr_nobf PERIOD reserved_keyword """ if len(p) == 3: p[0] = ast.FunctionCall(p[1], p[2], lineno=p.lineno(1)) elif len(p) == 4: p[0] = ast.DotAccessor(p[1], p[3], lineno=p.lineno(1)) else: p[0] = ast.BracketAccessor(p[1], p[3],lineno=p.lineno(1))
def p_member_expr_nobf(self, p): """member_expr_nobf : primary_expr_no_brace | member_expr_nobf LBRACKET expr RBRACKET | member_expr_nobf PERIOD identifier | NEW member_expr arguments """ if len(p) == 2: p[0] = p[1] elif p[1] == 'new': p[0] = ast.NewExpr(p[2], p[3]) elif p[2] == '.': p[0] = ast.DotAccessor(p[1], p[3]) else: p[0] = ast.BracketAccessor(p[1], p[3])
def p_member_expr_nobf(self, p): """member_expr_nobf : primary_expr_no_brace | function_expr | member_expr_nobf LBRACKET expr RBRACKET | member_expr_nobf PERIOD identifier | member_expr_nobf PERIOD reserved_keyword | NEW member_expr arguments """ if len(p) == 2: p[0] = p[1] elif p[1] == 'new': p[0] = ast.NewExpr(p[2], p[3],lineno=p.lineno(2)) elif p[2] == '.': p[0] = ast.DotAccessor(p[1], p[3],lineno=p.lineno(1)) else: p[0] = ast.BracketAccessor(p[1], p[3],lineno=p.lineno(1))
def p_call_expr_nobf(self, p): """call_expr_nobf : member_expr_nobf arguments | call_expr_nobf arguments | call_expr_nobf LBRACKET expr RBRACKET | call_expr_nobf PERIOD identifier """ if len(p) == 3: try: lex_line = p.slice[1].lineno lex_column = find_column(p.lexer.lexer.lexdata, p.slice[1]) except AttributeError: lex_line = None lex_column = None p[0] = ast.FunctionCall(p[1], p[2], lex_line=lex_line, lex_column=lex_column) elif len(p) == 4: p[0] = ast.DotAccessor(p[1], p[3]) else: p[0] = ast.BracketAccessor(p[1], p[3])