pub struct ParseCtx<'a> {
pub lower: &'a dyn Fn(&str, Vec<Arg>) -> ParseResult<StepKind>,
pub modules: &'a ModuleTable,
pub reserved: &'a HashSet<String>,
pub funcs: RefCell<Vec<HashSet<String>>>,
pub imports: RefCell<Vec<Vec<String>>>,
pub exports: RefCell<Vec<String>>,
pub current_line: RefCell<usize>,
}Expand description
Parse context: shared lowering dispatcher plus module table for
static call resolution, with FUNC/import frames per braced body.
Fields§
§lower: &'a dyn Fn(&str, Vec<Arg>) -> ParseResult<StepKind>§modules: &'a ModuleTable§reserved: &'a HashSet<String>Host-registered function names for the FUNC shadow check
(empty when hosts are unknown).
funcs: RefCell<Vec<HashSet<String>>>FUNC scopes (innermost last) and import frames, pushed per
braced body; short borrows only,
never held across recursive parses.
imports: RefCell<Vec<Vec<String>>>§exports: RefCell<Vec<String>>EXPORT names in source order, validated at end of parse
(forward references allowed).
current_line: RefCell<usize>1-based source line of the statement currently lowering (the innermost split statement; updated per statement by the body loops, read as the base for nested splits). Lets every error carry its statement’s line without threading it through every header function by hand.
Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for ParseCtx<'a>
impl<'a> !RefUnwindSafe for ParseCtx<'a>
impl<'a> !Send for ParseCtx<'a>
impl<'a> !Sync for ParseCtx<'a>
impl<'a> !UnwindSafe for ParseCtx<'a>
impl<'a> Unpin for ParseCtx<'a>
impl<'a> UnsafeUnpin for ParseCtx<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more