mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
Remove Parse
trait (#6235)
This commit is contained in:
parent
83fe103d6e
commit
debfca3a11
25 changed files with 235 additions and 1420 deletions
|
@ -133,15 +133,15 @@ const fn is_starred(exp: &ast::Expr) -> bool {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{Parse, ParseErrorType};
|
||||
use ruff_python_ast::{self as ast};
|
||||
use crate::parser::parse_suite;
|
||||
use crate::ParseErrorType;
|
||||
|
||||
macro_rules! function_and_lambda {
|
||||
($($name:ident: $code:expr,)*) => {
|
||||
$(
|
||||
#[test]
|
||||
fn $name() {
|
||||
let parse_ast = ast::Suite::parse($code, "<test>");
|
||||
let parse_ast = crate::parser::parse_suite($code, "<test>");
|
||||
insta::assert_debug_snapshot!(parse_ast);
|
||||
}
|
||||
)*
|
||||
|
@ -172,7 +172,7 @@ mod tests {
|
|||
}
|
||||
|
||||
fn function_parse_error(src: &str) -> LexicalErrorType {
|
||||
let parse_ast = ast::Suite::parse(src, "<test>");
|
||||
let parse_ast = parse_suite(src, "<test>");
|
||||
parse_ast
|
||||
.map_err(|e| match e.error {
|
||||
ParseErrorType::Lexical(e) => e,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue