fn check_if_should_override_normal_precedence(
        &mut self,
        left_term: &S::R,
        operator: TokenKind,
        left_precedence: usize,
    ) -> BinaryExpressionPrefixKind<(S::R, Self)> {
        // We need to override the precedence of the < operator in the case where it
        // is the start of a specified function call.
        let maybe_prefix =
            if self.peek_token_kind_with_possible_attributized_type_list() == TokenKind::LessThan {
                match self.try_parse_specified_function_call(left_term) {
                    Some(r) => Some(BinaryExpressionPrefixKind::PrefixLessThan(r)),
                    None => None,
                }
            } else {
                None
            };
        match maybe_prefix {
            Some(r) => r,
            None => {
                // in PHP precedence of assignment in expression is bumped up to
                // recognize cases like !$x = ... or $a == $b || $c = ...
                // which should be parsed as !($x = ...) and $a == $b || ($c = ...)
                if left_precedence >= Operator::precedence_for_assignment_in_expressions() {
                    BinaryExpressionPrefixKind::PrefixNone
                } else {
                    match operator {
                        TokenKind::Equal if left_term.is_list_expression() => {
                            BinaryExpressionPrefixKind::PrefixAssignment
                        }
                        TokenKind::Equal
                        | TokenKind::PlusEqual
                        | TokenKind::MinusEqual
                        | TokenKind::StarEqual
                        | TokenKind::SlashEqual
                        | TokenKind::StarStarEqual
                        | TokenKind::DotEqual
                        | TokenKind::PercentEqual
                        | TokenKind::AmpersandEqual
                        | TokenKind::BarEqual
                        | TokenKind::CaratEqual
                        | TokenKind::LessThanLessThanEqual
                        | TokenKind::GreaterThanGreaterThanEqual
                        | TokenKind::QuestionQuestionEqual
                            if Self::can_be_used_as_lvalue(&left_term) =>
                        {
                            BinaryExpressionPrefixKind::PrefixAssignment
                        }
                        _ => BinaryExpressionPrefixKind::PrefixNone,
                    }
                }
            }
        }
    }
// detects if left_term and operator can be treated as a beginning of
// assignment (respecting the precedence of operator on the left of
// left term). Returns
// - PrefixNone - either operator is not one of assignment operators or
// precedence of the operator on the left is higher than precedence of
// assignment.
// - PrefixAssignment - left_term  and operator can be interpreted as a
// prefix of assignment
// - Prefix:LessThan - is the start of a specified function call f<T>(...)
detects if left_term and operator can be treated as a beginning of
assignment (respecting the precedence of operator on the left of
left term). Returns
PrefixNone - either operator is not one of assignment operators or
precedence of the operator on the left is higher than precedence of
assignment.
PrefixAssignment - left_term  and operator can be interpreted as a
prefix of assignment
Prefix:LessThan - is the start of a specified function call f(...)
detects if left_term and operator can be treated as a beginning of assignment ( respecting the precedence of operator on the left of left term ) . Returns PrefixNone - either operator is not one of assignment operators or precedence of the operator on the left is higher than precedence of assignment . PrefixAssignment - left_term and operator can be interpreted as a prefix of assignment Prefix : LessThan - is the start of a specified function call f ( ... )
fn check_if_should_override_normal_precedence(
        &mut self,
        left_term: &S::R,
        operator: TokenKind,
        left_precedence: usize,
    ) -> BinaryExpressionPrefixKind<(S::R, Self)> {
        // We need to override the precedence of the < operator in the case where it
        // is the start of a specified function call.
        let maybe_prefix =
            if self.peek_token_kind_with_possible_attributized_type_list() == TokenKind::LessThan {
                match self.try_parse_specified_function_call(left_term) {
                    Some(r) => Some(BinaryExpressionPrefixKind::PrefixLessThan(r)),
                    None => None,
                }
            } else {
                None
            };
        match maybe_prefix {
            Some(r) => r,
            None => {
                // in PHP precedence of assignment in expression is bumped up to
                // recognize cases like !$x = ... or $a == $b || $c = ...
                // which should be parsed as !($x = ...) and $a == $b || ($c = ...)
                if left_precedence >= Operator::precedence_for_assignment_in_expressions() {
                    BinaryExpressionPrefixKind::PrefixNone
                } else {
                    match operator {
                        TokenKind::Equal if left_term.is_list_expression() => {
                            BinaryExpressionPrefixKind::PrefixAssignment
                        }
                        TokenKind::Equal
                        | TokenKind::PlusEqual
                        | TokenKind::MinusEqual
                        | TokenKind::StarEqual
                        | TokenKind::SlashEqual
                        | TokenKind::StarStarEqual
                        | TokenKind::DotEqual
                        | TokenKind::PercentEqual
                        | TokenKind::AmpersandEqual
                        | TokenKind::BarEqual
                        | TokenKind::CaratEqual
                        | TokenKind::LessThanLessThanEqual
                        | TokenKind::GreaterThanGreaterThanEqual
                        | TokenKind::QuestionQuestionEqual
                            if Self::can_be_used_as_lvalue(&left_term) =>
                        {
                            BinaryExpressionPrefixKind::PrefixAssignment
                        }
                        _ => BinaryExpressionPrefixKind::PrefixNone,
                    }
                }
            }
        }
    }
fn check_if_should_override_normal_precedence ( & mut self , left_term : & S :: R , operator : TokenKind , left_precedence : usize , ) -> BinaryExpressionPrefixKind < ( S :: R , Self ) > { // We need to override the precedence of the < operator in the case where it // is the start of a specified function call. let maybe_prefix = if self . peek_token_kind_with_possible_attributized_type_list ( ) == TokenKind :: LessThan { match self . try_parse_specified_function_call ( left_term ) { Some ( r ) => Some ( BinaryExpressionPrefixKind :: PrefixLessThan ( r ) ) , None => None , } } else { None } ; match maybe_prefix { Some ( r ) => r , None => { // in PHP precedence of assignment in expression is bumped up to // recognize cases like !$x = ... or $a == $b || $c = ... // which should be parsed as !($x = ...) and $a == $b || ($c = ...) if left_precedence >= Operator :: precedence_for_assignment_in_expressions ( ) { BinaryExpressionPrefixKind :: PrefixNone } else { match operator { TokenKind :: Equal if left_term . is_list_expression ( ) => { BinaryExpressionPrefixKind :: PrefixAssignment } TokenKind :: Equal | TokenKind :: PlusEqual | TokenKind :: MinusEqual | TokenKind :: StarEqual | TokenKind :: SlashEqual | TokenKind :: StarStarEqual | TokenKind :: DotEqual | TokenKind :: PercentEqual | TokenKind :: AmpersandEqual | TokenKind :: BarEqual | TokenKind :: CaratEqual | TokenKind :: LessThanLessThanEqual | TokenKind :: GreaterThanGreaterThanEqual | TokenKind :: QuestionQuestionEqual if Self :: can_be_used_as_lvalue ( & left_term ) => { BinaryExpressionPrefixKind :: PrefixAssignment } _ => BinaryExpressionPrefixKind :: PrefixNone , } } } } }
detects if left_term and operator can be treated as a beginning of
assignment (respecting the precedence of operator on the left of
left term).
detects if left_term and operator can be treated as a beginning of assignment ( respecting the precedence of operator on the left of left term ) .
&mut self
left_term
&S::R
operator
TokenKind
left_precedence
usize
&mut self
left_term
&S::R
operator
TokenKind
left_precedence
usize