From 8a97eaf79ea2c9177e4b64e83fdb2ce54ecee425 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sat, 6 Dec 2025 01:05:00 -0800 Subject: [PATCH] Move StringState into module --- src/lib.rs | 119 ++++++++++---------------------------------- src/parser.rs | 6 --- src/string_state.rs | 7 +++ 3 files changed, 34 insertions(+), 98 deletions(-) create mode 100644 src/string_state.rs diff --git a/src/lib.rs b/src/lib.rs index 3d3ac56e..f5d659d0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,99 +5,33 @@ //! library interface. It may break or change at any time. pub(crate) use { + crate::attribute::{Attribute, AttributeDiscriminant}, crate::{ - alias::Alias, - alias_style::AliasStyle, - analyzer::Analyzer, - argument_parser::ArgumentParser, - assignment::Assignment, - assignment_resolver::AssignmentResolver, - ast::Ast, - attribute::{Attribute, AttributeDiscriminant}, - attribute_set::AttributeSet, - binding::Binding, - color::Color, - color_display::ColorDisplay, - command_color::CommandColor, - command_ext::CommandExt, - compilation::Compilation, - compile_error::CompileError, - compile_error_kind::CompileErrorKind, - compiler::Compiler, - condition::Condition, - conditional_operator::ConditionalOperator, - config::Config, - config_error::ConfigError, - constants::constants, - count::Count, - delimiter::Delimiter, - dependency::Dependency, - dump_format::DumpFormat, - enclosure::Enclosure, - error::Error, - evaluator::Evaluator, - execution_context::ExecutionContext, - executor::Executor, - expression::Expression, - format_string_part::FormatStringPart, - fragment::Fragment, - function::Function, - interpreter::Interpreter, - item::Item, - justfile::Justfile, - keyed::Keyed, - keyword::Keyword, - lexer::Lexer, - line::Line, - list::List, - load_dotenv::load_dotenv, - loader::Loader, - module_path::ModulePath, - name::Name, - namepath::Namepath, - ordinal::Ordinal, - output_error::OutputError, - parameter::Parameter, - parameter_kind::ParameterKind, - parser::Parser, - platform::Platform, - platform_interface::PlatformInterface, - position::Position, - positional::Positional, - ran::Ran, - range_ext::RangeExt, - recipe::Recipe, - recipe_resolver::RecipeResolver, - recipe_signature::RecipeSignature, - scope::Scope, - search::Search, - search_config::SearchConfig, - search_error::SearchError, - set::Set, - setting::Setting, - settings::Settings, - shebang::Shebang, - show_whitespace::ShowWhitespace, - signal::Signal, - signal_handler::SignalHandler, - source::Source, - string_delimiter::StringDelimiter, - string_kind::StringKind, - string_literal::StringLiteral, - subcommand::Subcommand, - suggestion::Suggestion, - table::Table, - thunk::Thunk, - token::Token, - token_kind::TokenKind, - unresolved_dependency::UnresolvedDependency, - unresolved_recipe::UnresolvedRecipe, - unstable_feature::UnstableFeature, - use_color::UseColor, - variables::Variables, - verbosity::Verbosity, - warning::Warning, - which::which, + alias::Alias, alias_style::AliasStyle, analyzer::Analyzer, argument_parser::ArgumentParser, + assignment::Assignment, assignment_resolver::AssignmentResolver, ast::Ast, + attribute_set::AttributeSet, binding::Binding, color::Color, color_display::ColorDisplay, + command_color::CommandColor, command_ext::CommandExt, compilation::Compilation, + compile_error::CompileError, compile_error_kind::CompileErrorKind, compiler::Compiler, + condition::Condition, conditional_operator::ConditionalOperator, config::Config, + config_error::ConfigError, constants::constants, count::Count, delimiter::Delimiter, + dependency::Dependency, dump_format::DumpFormat, enclosure::Enclosure, error::Error, + evaluator::Evaluator, execution_context::ExecutionContext, executor::Executor, + expression::Expression, format_string_part::FormatStringPart, fragment::Fragment, + function::Function, interpreter::Interpreter, item::Item, justfile::Justfile, keyed::Keyed, + keyword::Keyword, lexer::Lexer, line::Line, list::List, load_dotenv::load_dotenv, + loader::Loader, module_path::ModulePath, name::Name, namepath::Namepath, ordinal::Ordinal, + output_error::OutputError, parameter::Parameter, parameter_kind::ParameterKind, parser::Parser, + platform::Platform, platform_interface::PlatformInterface, position::Position, + positional::Positional, ran::Ran, range_ext::RangeExt, recipe::Recipe, + recipe_resolver::RecipeResolver, recipe_signature::RecipeSignature, scope::Scope, + search::Search, search_config::SearchConfig, search_error::SearchError, set::Set, + setting::Setting, settings::Settings, shebang::Shebang, show_whitespace::ShowWhitespace, + signal::Signal, signal_handler::SignalHandler, source::Source, + string_delimiter::StringDelimiter, string_kind::StringKind, string_literal::StringLiteral, + string_state::StringState, subcommand::Subcommand, suggestion::Suggestion, table::Table, + thunk::Thunk, token::Token, token_kind::TokenKind, unresolved_dependency::UnresolvedDependency, + unresolved_recipe::UnresolvedRecipe, unstable_feature::UnstableFeature, use_color::UseColor, + variables::Variables, verbosity::Verbosity, warning::Warning, which::which, }, camino::Utf8Path, clap::ValueEnum, @@ -264,6 +198,7 @@ mod source; mod string_delimiter; mod string_kind; mod string_literal; +mod string_state; mod subcommand; mod suggestion; mod table; diff --git a/src/parser.rs b/src/parser.rs index 21ab965c..1811bc95 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,11 +1,5 @@ use {super::*, TokenKind::*}; -enum StringState { - FormatContinue(StringKind), - FormatStart, - Normal, -} - /// Just language parser /// /// The parser is a (hopefully) straightforward recursive descent parser. diff --git a/src/string_state.rs b/src/string_state.rs new file mode 100644 index 00000000..af47567a --- /dev/null +++ b/src/string_state.rs @@ -0,0 +1,7 @@ +use super::*; + +pub(crate) enum StringState { + FormatContinue(StringKind), + FormatStart, + Normal, +}