Remove Parse trait (#6235)

This commit is contained in:
Micha Reiser 2023-08-01 18:35:03 +02:00 committed by GitHub
parent 83fe103d6e
commit debfca3a11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 235 additions and 1420 deletions

View file

@ -36,13 +36,13 @@ impl NeedsParentheses for ExprName {
#[cfg(test)]
mod tests {
use ruff_python_ast::{ModModule, Ranged};
use ruff_python_parser::Parse;
use ruff_python_ast::Ranged;
use ruff_python_parser::parse_program;
use ruff_text_size::{TextRange, TextSize};
#[test]
fn name_range_with_comments() {
let source = ModModule::parse("a # comment", "file.py").unwrap();
let source = parse_program("a # comment", "file.py").unwrap();
let expression_statement = source
.body

View file

@ -210,8 +210,8 @@ impl<'ast> IntoFormat<PyFormatContext<'ast>> for Suite {
#[cfg(test)]
mod tests {
use ruff_formatter::format;
use ruff_python_ast::Suite;
use ruff_python_parser::Parse;
use ruff_python_parser::parse_suite;
use crate::comments::Comments;
use crate::prelude::*;
@ -240,7 +240,7 @@ def trailing_func():
pass
"#;
let statements = Suite::parse(source, "test.py").unwrap();
let statements = parse_suite(source, "test.py").unwrap();
let context = PyFormatContext::new(PyFormatOptions::default(), source, Comments::default());