struct ReconstructCtx<'a> {
cfg: CfgInfo<'a>,
break_context_depth: usize,
special_jump_stack: Vec<(BlockId, SpecialJump)>,
mode: ReconstructMode,
}Fields§
§cfg: CfgInfo<'a>§break_context_depth: usizeThe depth of loop contexts we may break/continue to.
special_jump_stack: Vec<(BlockId, SpecialJump)>Stack of block ids that should be translated to special jumps (break/continue/do
nothing) in the current context.
The block where control-flow continues naturally after this block is kept at the top of the
stack.
mode: ReconstructModeImplementations§
Source§impl<'a> ReconstructCtx<'a>
impl<'a> ReconstructCtx<'a>
fn build( ctx: &TransformCtx, src_body: &'a ExprBody, ) -> Result<Self, Irreducible>
fn translate_statement(&self, st: &Statement) -> Statement
fn get_goto_kind(&self, target_block: BlockId) -> GotoKind
Sourcefn translate_jump(&mut self, span: Span, target_block: BlockId) -> Block
fn translate_jump(&mut self, span: Span, target_block: BlockId) -> Block
Translate a jump to the given block. The span is used to create the jump statement, if any.
fn translate_terminator(&mut self, terminator: &Terminator) -> Block
Sourcefn translate_block_itself(&mut self, block_id: BlockId) -> Block
fn translate_block_itself(&mut self, block_id: BlockId) -> Block
Translate just the block statements and terminator.
Sourcefn translate_block(&mut self, block_id: BlockId) -> Block
fn translate_block(&mut self, block_id: BlockId) -> Block
Translate a block including surrounding control-flow like looping.
fn translate_block_inner(&mut self, block_id: BlockId) -> Block
Auto Trait Implementations§
impl<'a> Freeze for ReconstructCtx<'a>
impl<'a> RefUnwindSafe for ReconstructCtx<'a>
impl<'a> Send for ReconstructCtx<'a>
impl<'a> Sync for ReconstructCtx<'a>
impl<'a> Unpin for ReconstructCtx<'a>
impl<'a> UnwindSafe for ReconstructCtx<'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
§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more