diff --git a/prism-compiler/src/lang/from_action_result.rs b/prism-compiler/src/lang/from_action_result.rs index afc2f79..952a336 100644 --- a/prism-compiler/src/lang/from_action_result.rs +++ b/prism-compiler/src/lang/from_action_result.rs @@ -1,7 +1,7 @@ use crate::lang::error::TypeError; use crate::lang::{PartialExpr, TcEnv, UnionIndex, ValueOrigin}; use prism_parser::core::cache::Allocs; -use prism_parser::grammar::action_result::ActionResult; +use prism_parser::action::action_result::ActionResult; use prism_parser::parser::var_map::{VarMap, VarMapValue}; use rpds::RedBlackTreeMap; use std::borrow::Cow; diff --git a/prism-parser-bootstrap/src/main.rs b/prism-parser-bootstrap/src/main.rs index 7f98e14..de16e17 100644 --- a/prism-parser-bootstrap/src/main.rs +++ b/prism-parser-bootstrap/src/main.rs @@ -4,7 +4,7 @@ use bumpalo::Bump; use prism_parser::core::cache::Allocs; use prism_parser::error::aggregate_error::ParseResultExt; use prism_parser::error::set_error::SetError; -use prism_parser::grammar::action_result::ActionResult; +use prism_parser::action::action_result::ActionResult; use prism_parser::grammar::from_action_result::{parse_grammarfile, parse_rule_action}; use prism_parser::grammar::GrammarFile; use prism_parser::{parse_grammar, run_parser_rule_here, META_GRAMMAR}; diff --git a/prism-parser/src/grammar/action_result.rs b/prism-parser/src/action/action_result.rs similarity index 100% rename from prism-parser/src/grammar/action_result.rs rename to prism-parser/src/action/action_result.rs diff --git a/prism-parser/src/grammar/apply_action.rs b/prism-parser/src/action/apply_action.rs similarity index 95% rename from prism-parser/src/grammar/apply_action.rs rename to prism-parser/src/action/apply_action.rs index f4b18c3..ed1cc2c 100644 --- a/prism-parser/src/grammar/apply_action.rs +++ b/prism-parser/src/action/apply_action.rs @@ -1,6 +1,6 @@ use crate::core::cache::Allocs; use crate::core::span::Span; -use crate::grammar::action_result::ActionResult; +use crate::action::action_result::ActionResult; use crate::grammar::rule_action::RuleAction; use crate::parser::var_map::{VarMap, VarMapValue}; diff --git a/prism-parser/src/action/mod.rs b/prism-parser/src/action/mod.rs new file mode 100644 index 0000000..7ab9f22 --- /dev/null +++ b/prism-parser/src/action/mod.rs @@ -0,0 +1,2 @@ +pub mod action_result; +pub mod apply_action; \ No newline at end of file diff --git a/prism-parser/src/core/cache.rs b/prism-parser/src/core/cache.rs index 48b85ed..24f9e8f 100644 --- a/prism-parser/src/core/cache.rs +++ b/prism-parser/src/core/cache.rs @@ -7,10 +7,10 @@ use crate::core::state::ParserState; use crate::error::error_printer::ErrorLabel; use crate::error::error_printer::ErrorLabel::Debug; use crate::error::{err_combine_opt, ParseError}; -use crate::grammar::action_result::ActionResult; use crate::parser::var_map::BlockCtx; use bumpalo::Bump; use bumpalo_try::BumpaloExtend; +use crate::action::action_result::ActionResult; #[derive(Eq, PartialEq, Hash, Clone)] pub struct CacheKey { diff --git a/prism-parser/src/core/context.rs b/prism-parser/src/core/context.rs index 01248fc..dd39967 100644 --- a/prism-parser/src/core/context.rs +++ b/prism-parser/src/core/context.rs @@ -1,4 +1,4 @@ -use crate::grammar::action_result::ActionResult; +use crate::action::action_result::ActionResult; use crate::parser::var_map::VarMap; use std::hash::{Hash, Hasher}; use std::ops::{Deref, DerefMut}; diff --git a/prism-parser/src/grammar/from_action_result.rs b/prism-parser/src/grammar/from_action_result.rs index bad2941..b351987 100644 --- a/prism-parser/src/grammar/from_action_result.rs +++ b/prism-parser/src/grammar/from_action_result.rs @@ -1,6 +1,6 @@ use crate::core::cache::Allocs; -use crate::grammar::action_result::ActionResult; -use crate::grammar::action_result::ActionResult::*; +use crate::action::action_result::ActionResult; +use crate::action::action_result::ActionResult::*; use crate::grammar::escaped_string::EscapedString; use crate::grammar::rule_action::RuleAction; use crate::grammar::{AnnotatedRuleExpr, Block, GrammarFile, Rule, RuleExpr}; diff --git a/prism-parser/src/grammar/mod.rs b/prism-parser/src/grammar/mod.rs index 1381b97..1caf2e1 100644 --- a/prism-parser/src/grammar/mod.rs +++ b/prism-parser/src/grammar/mod.rs @@ -3,8 +3,6 @@ use crate::grammar::rule_action::RuleAction; use crate::grammar::serde_leak::*; use serde::{Deserialize, Serialize}; -pub mod action_result; -pub mod apply_action; pub mod escaped_string; pub mod from_action_result; pub mod rule_action; diff --git a/prism-parser/src/grammar/rule_action.rs b/prism-parser/src/grammar/rule_action.rs index f7c986e..bbc4b49 100644 --- a/prism-parser/src/grammar/rule_action.rs +++ b/prism-parser/src/grammar/rule_action.rs @@ -1,4 +1,4 @@ -use crate::grammar::action_result::ActionResult; +use crate::action::action_result::ActionResult; use crate::grammar::escaped_string::EscapedString; use crate::grammar::serde_leak::*; use serde::{Deserialize, Serialize}; diff --git a/prism-parser/src/lib.rs b/prism-parser/src/lib.rs index e2e3854..d610118 100644 --- a/prism-parser/src/lib.rs +++ b/prism-parser/src/lib.rs @@ -14,6 +14,7 @@ pub mod core; pub mod error; pub mod grammar; pub mod parser; +pub mod action; pub static META_GRAMMAR: LazyLock> = LazyLock::new(|| { let meta_grammar = include_bytes!("../resources/bootstrap.bincode"); diff --git a/prism-parser/src/parser/parser_instance.rs b/prism-parser/src/parser/parser_instance.rs index b38f9b8..afdb8fd 100644 --- a/prism-parser/src/parser/parser_instance.rs +++ b/prism-parser/src/parser/parser_instance.rs @@ -6,7 +6,7 @@ use crate::core::state::ParserState; use crate::error::aggregate_error::AggregatedParseError; use crate::error::error_printer::ErrorLabel; use crate::error::ParseError; -use crate::grammar::action_result::ActionResult; +use crate::action::action_result::ActionResult; use crate::grammar::GrammarFile; use crate::parser::var_map::VarMap; use crate::META_GRAMMAR; diff --git a/prism-parser/src/parser/parser_rule.rs b/prism-parser/src/parser/parser_rule.rs index b29fda9..e29775b 100644 --- a/prism-parser/src/parser/parser_rule.rs +++ b/prism-parser/src/parser/parser_rule.rs @@ -5,7 +5,7 @@ use crate::core::presult::PResult; use crate::core::state::ParserState; use crate::error::error_printer::ErrorLabel; use crate::error::ParseError; -use crate::grammar::action_result::ActionResult; +use crate::action::action_result::ActionResult; use crate::parser::var_map::{VarMap, VarMapValue}; impl<'arn, 'grm, E: ParseError>> ParserState<'arn, 'grm, E> { diff --git a/prism-parser/src/parser/parser_rule_block.rs b/prism-parser/src/parser/parser_rule_block.rs index b3dac5a..03c63c4 100644 --- a/prism-parser/src/parser/parser_rule_block.rs +++ b/prism-parser/src/parser/parser_rule_block.rs @@ -7,7 +7,7 @@ use crate::core::adaptive::{Constructor, GrammarState}; use crate::core::context::ParserContext; use crate::core::pos::Pos; use crate::core::state::ParserState; -use crate::grammar::action_result::ActionResult; +use crate::action::action_result::ActionResult; use crate::grammar::{RuleAnnotation, RuleExpr}; use crate::parser::var_map::{BlockCtx, VarMap}; diff --git a/prism-parser/src/parser/parser_rule_expr.rs b/prism-parser/src/parser/parser_rule_expr.rs index 9d9e7df..2e0e97e 100644 --- a/prism-parser/src/parser/parser_rule_expr.rs +++ b/prism-parser/src/parser/parser_rule_expr.rs @@ -5,8 +5,8 @@ use crate::core::presult::PResult; use crate::core::state::ParserState; use crate::error::error_printer::ErrorLabel; use crate::error::ParseError; -use crate::grammar::action_result::ActionResult; -use crate::grammar::apply_action::apply_action; +use crate::action::action_result::ActionResult; +use crate::action::apply_action::apply_action; use crate::grammar::escaped_string::EscapedString; use crate::grammar::from_action_result::parse_grammarfile; use crate::grammar::rule_action::RuleAction; diff --git a/prism-parser/src/parser/var_map.rs b/prism-parser/src/parser/var_map.rs index 058602a..bc7abc5 100644 --- a/prism-parser/src/parser/var_map.rs +++ b/prism-parser/src/parser/var_map.rs @@ -5,7 +5,7 @@ use crate::core::pos::Pos; use crate::core::state::ParserState; use crate::error::error_printer::ErrorLabel; use crate::error::ParseError; -use crate::grammar::action_result::ActionResult; +use crate::action::action_result::ActionResult; use crate::grammar::RuleExpr; use std::fmt::{Debug, Formatter}; use std::iter;