pub fn is_lit(&self) -> bool {
        match self {
            Self::Lit(..) => return true,
            Self::Unary(expr_unary) => {
                if let Self::Lit(expr) = &expr_unary.expr {
                    return matches!(
                        expr.as_ref(),
                        ast::ExprLit {
                            lit: ast::Lit::Number(..),
                            ..
                        }
                    );
                }
            }
            _ => (),
        }

        false
    }
/// Check if this expression is a literal expression.
///
/// There are exactly two kinds of literal expressions:
/// * Ones that are ExprLit
/// * Unary expressions which are the negate operation.
Check if this expression is a literal expression.
There are exactly two kinds of literal expressions:
Ones that are ExprLit
Unary expressions which are the negate operation.
Check if this expression is a literal expression . There are exactly two kinds of literal expressions : Ones that are ExprLit Unary expressions which are the negate operation .
pub fn is_lit(&self) -> bool {
        match self {
            Self::Lit(..) => return true,
            Self::Unary(expr_unary) => {
                if let Self::Lit(expr) = &expr_unary.expr {
                    return matches!(
                        expr.as_ref(),
                        ast::ExprLit {
                            lit: ast::Lit::Number(..),
                            ..
                        }
                    );
                }
            }
            _ => (),
        }
        false
    }
pub fn is_lit ( & self ) -> bool { match self { Self :: Lit ( .. ) => return true , Self :: Unary ( expr_unary ) => { if let Self :: Lit ( expr ) = & expr_unary . expr { return matches ! ( expr as_ref ( ) ast ExprLit { lit ast Lit Number ( ) } ) ; } } _ => ( ) , } false }
Check if this expression is a literal expression.
Check if this expression is a literal expression .
&self
&self