mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-21 19:05:09 +00:00
Switch to Rust 2024 edition (#18129)
This commit is contained in:
parent
e67b35743a
commit
9ae698fe30
1082 changed files with 4211 additions and 3300 deletions
|
@ -13,8 +13,8 @@ use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
|
|||
|
||||
use crate::error::{FStringKind, StarTupleKind, UnparenthesizedNamedExprKind};
|
||||
use crate::parser::progress::ParserProgress;
|
||||
use crate::parser::{helpers, FunctionKind, Parser};
|
||||
use crate::string::{parse_fstring_literal_element, parse_string_literal, StringType};
|
||||
use crate::parser::{FunctionKind, Parser, helpers};
|
||||
use crate::string::{StringType, parse_fstring_literal_element, parse_string_literal};
|
||||
use crate::token::{TokenKind, TokenValue};
|
||||
use crate::token_set::TokenSet;
|
||||
use crate::{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use ruff_python_ast::{self as ast, CmpOp, Expr, ExprContext, Number};
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
|
||||
use crate::{error::RelaxedDecoratorError, TokenKind};
|
||||
use crate::{TokenKind, error::RelaxedDecoratorError};
|
||||
|
||||
/// Set the `ctx` for `Expr::Id`, `Expr::Attribute`, `Expr::Subscript`, `Expr::Starred`,
|
||||
/// `Expr::Tuple` and `Expr::List`. If `expr` is either `Expr::Tuple` or `Expr::List`,
|
||||
|
@ -58,7 +58,7 @@ pub(super) fn detect_invalid_pre_py39_decorator_node(
|
|||
Expr::Name(_) => return None,
|
||||
|
||||
Expr::Attribute(attribute) => {
|
||||
return detect_invalid_pre_py39_decorator_node(&attribute.value)
|
||||
return detect_invalid_pre_py39_decorator_node(&attribute.value);
|
||||
}
|
||||
|
||||
Expr::Call(_) => return Some((RelaxedDecoratorError::CallExpression, expr.range())),
|
||||
|
|
|
@ -2,11 +2,11 @@ use ruff_python_ast::name::Name;
|
|||
use ruff_python_ast::{self as ast, Expr, ExprContext, Number, Operator, Pattern, Singleton};
|
||||
use ruff_text_size::{Ranged, TextSize};
|
||||
|
||||
use crate::ParseErrorType;
|
||||
use crate::parser::progress::ParserProgress;
|
||||
use crate::parser::{recovery, Parser, RecoveryContextKind, SequenceMatchPatternParentheses};
|
||||
use crate::parser::{Parser, RecoveryContextKind, SequenceMatchPatternParentheses, recovery};
|
||||
use crate::token::{TokenKind, TokenValue};
|
||||
use crate::token_set::TokenSet;
|
||||
use crate::ParseErrorType;
|
||||
|
||||
use super::expression::ExpressionContext;
|
||||
|
||||
|
|
|
@ -9,17 +9,17 @@ use ruff_python_ast::{
|
|||
use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
|
||||
use crate::error::StarTupleKind;
|
||||
use crate::parser::expression::{ParsedExpr, EXPR_SET};
|
||||
use crate::parser::expression::{EXPR_SET, ParsedExpr};
|
||||
use crate::parser::progress::ParserProgress;
|
||||
use crate::parser::{
|
||||
helpers, FunctionKind, Parser, RecoveryContext, RecoveryContextKind, WithItemKind,
|
||||
FunctionKind, Parser, RecoveryContext, RecoveryContextKind, WithItemKind, helpers,
|
||||
};
|
||||
use crate::token::{TokenKind, TokenValue};
|
||||
use crate::token_set::TokenSet;
|
||||
use crate::{Mode, ParseErrorType, UnsupportedSyntaxErrorKind};
|
||||
|
||||
use super::expression::ExpressionContext;
|
||||
use super::Parenthesized;
|
||||
use super::expression::ExpressionContext;
|
||||
|
||||
/// Tokens that represent compound statements.
|
||||
const COMPOUND_STMT_SET: TokenSet = TokenSet::new([
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{parse, parse_expression, parse_module, Mode, ParseOptions};
|
||||
use crate::{Mode, ParseOptions, parse, parse_expression, parse_module};
|
||||
|
||||
#[test]
|
||||
fn test_modes() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue