Beispiel #1
0
 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])
Beispiel #2
0
 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))
Beispiel #3
0
 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])