refactor: rename syntux mod to parse

This commit is contained in:
Caleb Cartwright 2021-12-20 17:55:48 -06:00 committed by Caleb Cartwright
parent 0346bc74a7
commit 40b73d8fee
10 changed files with 15 additions and 13 deletions

View File

@ -14,8 +14,8 @@
use crate::formatting::generated::is_generated_file;
use crate::issues::BadIssueSeeker;
use crate::modules::Module;
use crate::syntux::parser::{DirectoryOwnership, Parser, ParserError};
use crate::syntux::session::ParseSess;
use crate::parse::parser::{DirectoryOwnership, Parser, ParserError};
use crate::parse::session::ParseSess;
use crate::utils::{contains_skip, count_newlines};
use crate::visitor::FmtVisitor;
use crate::{modules, source_file, ErrorKind, FormatReport, Input, Session};

View File

@ -40,8 +40,8 @@
use crate::formatting::{FormatErrorMap, FormattingError, ReportedErrors, SourceFile};
use crate::issues::Issue;
use crate::modules::ModuleResolutionError;
use crate::parse::parser::DirectoryOwnership;
use crate::shape::Indent;
use crate::syntux::parser::DirectoryOwnership;
use crate::utils::indent_next_line;
pub use crate::config::{
@ -77,6 +77,7 @@
pub(crate) mod modules;
mod overflow;
mod pairs;
mod parse;
mod patterns;
mod release_channel;
mod reorder;
@ -89,7 +90,6 @@
mod spanned;
mod stmt;
mod string;
mod syntux;
#[cfg(test)]
mod test;
mod types;

View File

@ -12,10 +12,10 @@
use crate::attr::MetaVisitor;
use crate::config::FileName;
use crate::items::is_mod_decl;
use crate::syntux::parser::{
use crate::parse::parser::{
Directory, DirectoryOwnership, ModError, ModulePathSuccess, Parser, ParserError,
};
use crate::syntux::session::ParseSess;
use crate::parse::session::ParseSess;
use crate::utils::{contains_skip, mk_sp};
mod visitor;

View File

@ -3,8 +3,8 @@
use rustc_span::Symbol;
use crate::attr::MetaVisitor;
use crate::syntux::parser::Parser;
use crate::syntux::session::ParseSess;
use crate::parse::parser::Parser;
use crate::parse::session::ParseSess;
pub(crate) struct ModItem {
pub(crate) item: ast::Item,

2
src/parse/mod.rs Normal file
View File

@ -0,0 +1,2 @@
pub(crate) mod parser;
pub(crate) mod session;

View File

@ -11,7 +11,7 @@
use rustc_span::{sym, symbol::kw, Span};
use crate::attr::first_attr_value_str_by_name;
use crate::syntux::session::ParseSess;
use crate::parse::session::ParseSess;
use crate::Input;
pub(crate) type DirectoryOwnership = rustc_expand::module::DirOwnership;

View File

@ -222,7 +222,7 @@ pub(crate) fn get_original_snippet(&self, file_name: &FileName) -> Option<Lrc<St
}
}
// Methods that should be restricted within the syntux module.
// Methods that should be restricted within the parse module.
impl ParseSess {
pub(super) fn emit_diagnostics(&self, diagnostics: Vec<Diagnostic>) {
for diagnostic in diagnostics {

View File

@ -7,9 +7,9 @@
use rustc_span::Span;
use crate::config::{Config, IndentStyle};
use crate::parse::session::ParseSess;
use crate::shape::Shape;
use crate::skip::SkipContext;
use crate::syntux::session::ParseSess;
use crate::visitor::SnippetProvider;
use crate::FormatReport;

View File

@ -4,7 +4,7 @@
use crate::config::FileName;
use crate::emitter::{self, Emitter};
use crate::syntux::session::ParseSess;
use crate::parse::session::ParseSess;
use crate::NewlineStyle;
#[cfg(test)]

View File

@ -16,13 +16,13 @@
};
use crate::macros::{macro_style, rewrite_macro, rewrite_macro_def, MacroPosition};
use crate::modules::Module;
use crate::parse::session::ParseSess;
use crate::rewrite::{Rewrite, RewriteContext};
use crate::shape::{Indent, Shape};
use crate::skip::{is_skip_attr, SkipContext};
use crate::source_map::{LineRangeUtils, SpanUtils};
use crate::spanned::Spanned;
use crate::stmt::Stmt;
use crate::syntux::session::ParseSess;
use crate::utils::{
self, contains_skip, count_newlines, depr_skip_annotation, format_unsafety, inner_attributes,
last_line_width, mk_sp, ptr_vec_to_ref_vec, rewrite_ident, starts_with_newline, stmt_expr,