expr : LIST LPAREN assignment_list RPAREN EQUALS expr
770990
def p_expr_list_assign(p):
    ''
    p[0] = ast.ListAssignment(p[3], p[6], lineno=p.lineno(1))
1120811
def p_comparison_in_list(self, p):
        
        if len(p) == 2:
            p[0] = Comparison(operator=p[1])
        else:
            p[0] = Comparison(operator='%s %s' % (p[1], p[2]))
15906
def p_expr1(p):
    
    p[0] = node.expr(op=p[1], args=node.expr_list([p[2]]))
1230545
def _expr2code(self, arg_list, expr):
        """"""
        code = lambdastr(arg_list, expr)
        function_code = code.split(':')[1].strip()
        #for arg in arg_list:
        #    function_code = function_code.replace(arg.name, 'self.'+arg.name)

        return function_code
1315687
def p_let_arr_substr_in_args(p):
    
    i = 2 if p[1].upper() == 'LET' else 1

    id_ = p[i]
    arg_list = p[i + 2]
    substr = (arg_list.children.pop().value,
              make_number(gl.MAX_STRSLICE_IDX, lineno=p.lineno(i + 3)))
    expr_ = p[i + 6]
    p[0] = make_array_substr_assign(p.lineno(i), id_, arg_list, substr, expr_)
1144891
def p_ret(p):
    
    if len(p) == 2:
        p[0] = node.expr_list([p[1]])
    elif len(p) == 3:
        p[0] = node.expr_list([])
    elif len(p) == 4:
        assert isinstance(p[2], node.expr_list)
        p[0] = p[2]
    else:
        assert 0
    for ident in p[0]:
        ident.props = "F"
946688
def p_lexpr(p):
    
    global LET_ASSIGNMENT

    LET_ASSIGNMENT = True  # Mark we're about to start a LET sentence

    if p[1] == 'LET':
        p[0] = p[2]
        i = 2
    else:
        p[0] = p[1]
        i = 1

    SYMBOL_TABLE.access_id(p[i], p.lineno(i))
1110303
private List<Variable> parseAssignRange(Sequence sequence, TokenList tokens, TokenList.Token t0) {
        // find assignment symbol
        TokenList.Token tokenAssign = t0.next;
        while( tokenAssign != null && tokenAssign.symbol != Symbol.ASSIGN ) {
            tokenAssign = tokenAssign.next;
        }

        if( tokenAssign == null )
            throw new ParseError("Can't find assignment operator");

        // see if it is a sub matrix before
        if( tokenAssign.previous.symbol == Symbol.PAREN_RIGHT ) {
            TokenList.Token start = t0.next;
            if( start.symbol != Symbol.PAREN_LEFT )
                throw new ParseError(("Expected left param for assignment"));
            TokenList.Token end = tokenAssign.previous;
            TokenList subTokens = tokens.extractSubList(start,end);
            subTokens.remove(subTokens.getFirst());
            subTokens.remove(subTokens.getLast());

            handleParentheses(subTokens,sequence);

            List<TokenList.Token> inputs = parseParameterCommaBlock(subTokens, sequence);

            if (inputs.isEmpty())
                throw new ParseError("Empty function input parameters");

            List<Variable> range = new ArrayList<>();
            addSubMatrixVariables(inputs, range);
            if( range.size() != 1 && range.size() != 2 ) {
                throw new ParseError("Unexpected number of range variables.  1 or 2 expected");
            }
            return range;
        }

        return null;
    }
995460
function parseAssignment() {
                    var expr, value, token, content = [];

                    expr = parseAdditive();

                    if (typeof expr !== 'undefined' && expr.subtype === 'variable') {
                        token = lexer.peek();
                        if (matchOp(token, ':=')) {
                            lexer.next();

                            content.push(expr);
                            value = parseAssignment();

                            while (value.subtype === 'assignment') {
                                content = content.concat(value.content);
                                value = value.value;
                            }

                            return new MathLib.Expression({
                                subtype: 'assignment',
                                content: content,
                                value: value
                            });
                        }
                        return expr;
                    }

                    return expr;
                }
1306013
def p_argument_list(self, p):
        
        if len(p) == 2:
            p[0] = [p[1]]
        else:
            p[1].append(p[3])
            p[0] = p[1]
46129
def p_string_expr_lp(p):
    
    if p[2].type_ != TYPE.string:
        syntax_error(p.lexer.lineno,
                     "Expected a string type expression. "
                     "Got %s type instead" % TYPE.to_string(p[2].type_))
        p[0] = None
    else:
        p[0] = make_strslice(p.lexer.lineno, p[2], p[4][0], p[4][1])
1365770
def p_expression_inlist(self, p):
        '''  
        '''
        _LOGGER.debug("expresion -> expresion IN lexp")

        if self._autodefine_vars:
            self._init_vars(TypedList([]), p[3])

        if p[3].type != TypedClass.LIST: raise TypeError("expected list for IN operator")
        
        retval = False
        for v in p[3].value:
            if p[1] == v:
                retval = True
                break
        
        p[0] = TypedClass(retval, TypedClass.BOOLEAN)
541695
def eval_expr(expr, context):
    
    if isinstance(expr, list):
        rv = []
        for item in expr:
            rv.append(eval_expr(item, context))
        return rv
    if isinstance(expr, dict):
        rv = {}
        for k, v in expr.iteritems():
            rv[k] = eval_expr(v, context)
        kwargs = rv.pop("__kwargs", None)
        if kwargs:
            rv.update(kwargs)
        return rv
    if isinstance(expr, Expression):
        return expr.eval(context)
    return expr
1255982
def _handle_expr_list(self, node, scope, ctxt, stream):
        
        self._dlog("handling expression list")
        exprs = [
            self._handle_node(expr, scope, ctxt, stream) for expr in node.exprs
        ]
        return exprs
1146511
def bracketedList(l, r, sep, expr, allow_missing_close=False):
  
  # We may need to backtrack for lists, because of list comprehension, but not for
  # any of the other lists
  strict = l != '['
  closer = sym(r) if not allow_missing_close else p.Optional(sym(r))
  if strict:
    return sym(l) - listMembers(sep, expr) - closer
  else:
    return sym(l) + listMembers(sep, expr) + closer
1167528
def p_exprgt(p):
    
    a = int(p[1]) if p[1].isdigit() else 0
    b = int(p[3]) if p[3].isdigit() else 0

    p[0] = '1' if a > b else '0'
1065308
def equal(list1, list2):
    
    return [item1 == item2 for item1, item2 in broadcast_zip(list1, list2)]