Skip to content
This repository was archived by the owner on May 11, 2023. It is now read-only.

Commit 3ec5114

Browse files
committed
Accept snapshot changes
1 parent 7bacfb2 commit 3ec5114

File tree

104 files changed

+1375
-13631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1375
-13631
lines changed

compiler/ast/src/constant.rs

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ mod tests {
140140
use crate::{fold::Fold, *};
141141

142142
let range = TextRange::default();
143+
#[allow(clippy::let_unit_value)]
143144
let custom = ();
144145
let ast = Located {
145146
range,

compiler/parser/src/parser.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ pub fn parse_expression(source: &str, path: &str) -> Result<ast::Expr, ParseErro
8585
/// somewhat silly, location:
8686
///
8787
/// ```
88-
/// use rustpython_parser::{ast::Location, parse_expression_located};
88+
/// use ruff_text_size::TextSize;
89+
/// use rustpython_parser::{parse_expression_located};
8990
///
90-
/// let expr = parse_expression_located("1 + 2", "<embedded>", Location::from(400));
91+
/// let expr = parse_expression_located("1 + 2", "<embedded>", TextSize::from(400));
9192
/// assert!(expr.is_ok());
9293
/// ```
9394
pub fn parse_expression_located(
@@ -144,7 +145,8 @@ pub fn parse(source: &str, mode: Mode, source_path: &str) -> Result<ast::Mod, Pa
144145
/// # Example
145146
///
146147
/// ```
147-
/// use rustpython_parser::{ast::Location, Mode, parse_located};
148+
/// use ruff_text_size::TextSize;
149+
/// use rustpython_parser::{Mode, parse_located};
148150
///
149151
/// let source = r#"
150152
/// def fib(i):
@@ -155,7 +157,7 @@ pub fn parse(source: &str, mode: Mode, source_path: &str) -> Result<ast::Mod, Pa
155157
///
156158
/// print(fib(42))
157159
/// "#;
158-
/// let program = parse_located(source, Mode::Module, "<embedded>", Location::from(0));
160+
/// let program = parse_located(source, Mode::Module, "<embedded>", TextSize::from(0));
159161
/// assert!(program.is_ok());
160162
/// ```
161163
pub fn parse_located(
@@ -583,9 +585,9 @@ except* OSError as e:
583585
fn test_modes() {
584586
let source = "a[0][1][2][3][4]";
585587

586-
assert!(parse(&source, Mode::Expression, "<embedded>").is_ok());
587-
assert!(parse(&source, Mode::Module, "<embedded>").is_ok());
588-
assert!(parse(&source, Mode::Interactive, "<embedded>").is_ok());
588+
assert!(parse(source, Mode::Expression, "<embedded>").is_ok());
589+
assert!(parse(source, Mode::Module, "<embedded>").is_ok());
590+
assert!(parse(source, Mode::Interactive, "<embedded>").is_ok());
589591
}
590592

591593
#[test]

compiler/parser/src/snapshots/rustpython_parser__context__tests__ann_assign_name.snap

+4-40
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__context__tests__assign_attribute.snap

+7-70
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__context__tests__assign_for.snap

+7-70
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)