Skip to content

Commit

Permalink
Move actions to own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanBrouwer committed Oct 6, 2024
1 parent daf177e commit 1f9781b
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion prism-compiler/src/lang/from_action_result.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion prism-parser-bootstrap/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
2 changes: 2 additions & 0 deletions prism-parser/src/action/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod action_result;
pub mod apply_action;
2 changes: 1 addition & 1 deletion prism-parser/src/core/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion prism-parser/src/core/context.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
4 changes: 2 additions & 2 deletions prism-parser/src/grammar/from_action_result.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
2 changes: 0 additions & 2 deletions prism-parser/src/grammar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion prism-parser/src/grammar/rule_action.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
1 change: 1 addition & 0 deletions prism-parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub mod core;
pub mod error;
pub mod grammar;
pub mod parser;
pub mod action;

pub static META_GRAMMAR: LazyLock<GrammarFile<'static, 'static>> = LazyLock::new(|| {
let meta_grammar = include_bytes!("../resources/bootstrap.bincode");
Expand Down
2 changes: 1 addition & 1 deletion prism-parser/src/parser/parser_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion prism-parser/src/parser/parser_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<L = ErrorLabel<'grm>>> ParserState<'arn, 'grm, E> {
Expand Down
2 changes: 1 addition & 1 deletion prism-parser/src/parser/parser_rule_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
4 changes: 2 additions & 2 deletions prism-parser/src/parser/parser_rule_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion prism-parser/src/parser/var_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1f9781b

Please sign in to comment.