From 3aa12c1be9918bf7040432daf3455b6d93effa5a Mon Sep 17 00:00:00 2001 From: Peter Ammon Date: Sat, 29 Jun 2024 12:29:40 -0700 Subject: [PATCH] Rename ParseExecutionContext to ExecutionContext --- src/parse_execution.rs | 6 +++--- src/parser.rs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/parse_execution.rs b/src/parse_execution.rs index 6bf6f0d56..e6ea4e214 100644 --- a/src/parse_execution.rs +++ b/src/parse_execution.rs @@ -77,7 +77,7 @@ pub enum EndExecutionReason { } #[derive(Default)] -pub struct ParseExecutionContext { +pub struct ExecutionContext { pstree: RefCell>, // If set, one of our processes received a cancellation signal (INT or QUIT) so we are @@ -102,7 +102,7 @@ struct CachedLineno { count: usize, } -impl ParseExecutionContext { +impl ExecutionContext { pub fn swap(left: &Self, right: Self) -> Self { left.pstree.swap(&right.pstree); left.cancel_signal.swap(&right.cancel_signal); @@ -133,7 +133,7 @@ macro_rules! report_error_formatted { }}; } -impl<'a> ParseExecutionContext { +impl<'a> ExecutionContext { /// Construct a context in preparation for evaluating a node in a tree, with the given block_io. /// The execution context may access the parser and parent job group (if any) through ctx. pub fn new(pstree: ParsedSourceRef, block_io: IoChain) -> Self { diff --git a/src/parser.rs b/src/parser.rs index 5633b9f2e..cfe92c6bb 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -21,7 +21,7 @@ use crate::parse_constants::{ ParseError, ParseErrorList, ParseTreeFlags, FISH_MAX_EVAL_DEPTH, FISH_MAX_STACK_DEPTH, SOURCE_LOCATION_UNKNOWN, }; -use crate::parse_execution::{EndExecutionReason, ParseExecutionContext}; +use crate::parse_execution::{EndExecutionReason, ExecutionContext}; use crate::parse_tree::{parse_source, ParsedSourceRef}; use crate::proc::{job_reap, JobGroupRef, JobList, JobRef, ProcStatus}; use crate::signal::{signal_check_cancel, signal_clear_cancel, Signal}; @@ -363,7 +363,7 @@ pub enum CancelBehavior { pub struct Parser { /// The current execution context. - execution_context: RefCell>, + execution_context: RefCell>, /// The jobs associated with this parser. job_list: RefCell, @@ -429,7 +429,7 @@ impl Parser { result } - fn execution_context(&self) -> Ref<'_, Option> { + fn execution_context(&self) -> Ref<'_, Option> { self.execution_context.borrow() } @@ -604,13 +604,13 @@ impl Parser { std::mem::replace(&mut self.execution_context.borrow_mut(), new_value) } else { #[allow(clippy::unnecessary_unwrap)] - Some(ParseExecutionContext::swap( + Some(ExecutionContext::swap( self.execution_context.borrow().as_ref().unwrap(), new_value.unwrap(), )) } }, - Some(ParseExecutionContext::new(ps.clone(), block_io.clone())), + Some(ExecutionContext::new(ps.clone(), block_io.clone())), ); // Check the exec count so we know if anything got executed.