Remove parser dependency from ruff-python-ast (#6096)

This commit is contained in:
Micha Reiser 2023-07-26 17:47:22 +02:00 committed by GitHub
parent 99127243f4
commit 2cf00fee96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
658 changed files with 1714 additions and 1546 deletions

View file

@ -92,7 +92,7 @@ use std::cell::Cell;
use std::fmt::Debug;
use std::rc::Rc;
use rustpython_parser::ast::{Mod, Ranged};
use rustpython_ast::{Mod, Ranged};
pub(crate) use format::{
dangling_comments, dangling_node_comments, leading_alternate_branch_comments, leading_comments,
@ -100,7 +100,7 @@ pub(crate) use format::{
};
use ruff_formatter::{SourceCode, SourceCodeSlice};
use ruff_python_ast::node::AnyNodeRef;
use ruff_python_ast::source_code::CommentRanges;
use ruff_python_index::CommentRanges;
use crate::comments::debug::{DebugComment, DebugComments};
use crate::comments::map::MultiMap;
@ -414,12 +414,12 @@ struct CommentsData<'a> {
#[cfg(test)]
mod tests {
use insta::assert_debug_snapshot;
use rustpython_parser::ast::Mod;
use rustpython_ast::Mod;
use rustpython_parser::lexer::lex;
use rustpython_parser::{parse_tokens, Mode};
use ruff_formatter::SourceCode;
use ruff_python_ast::source_code::{CommentRanges, CommentRangesBuilder};
use ruff_python_index::{CommentRanges, CommentRangesBuilder};
use crate::comments::Comments;