Skip to main content

InlineSegmentParser

Struct InlineSegmentParser 

Source
struct InlineSegmentParser<'parser, 'slice, 'src> {
    parser: &'parser mut Parser<'src>,
    slice: &'slice str,
    bytes: &'slice [u8],
    base: usize,
    out: Vec<Inline>,
    pending: String,
    pending_source_start: Option<usize>,
    i: usize,
    text_start: usize,
    style: InlineStyle,
    close: Option<Delimiter>,
}

Fields§

§parser: &'parser mut Parser<'src>§slice: &'slice str§bytes: &'slice [u8]§base: usize§out: Vec<Inline>§pending: String§pending_source_start: Option<usize>§i: usize§text_start: usize§style: InlineStyle§close: Option<Delimiter>

Implementations§

Source§

impl<'parser, 'slice, 'src> InlineSegmentParser<'parser, 'slice, 'src>

Source

const fn new( parser: &'parser mut Parser<'src>, slice: &'slice str, base: usize, from: usize, style: InlineStyle, close: Option<Delimiter>, ) -> Self

Source

fn parse(self) -> ParsedSegment

Source

fn flush(&mut self, to: usize)

Source

fn push_pending_escape(&mut self, text: char, width: usize)

Source

fn handle_backslash(&mut self)

Source

fn handle_star(&mut self) -> Option<ParsedSegment>

Source

fn handle_code(&mut self)

Source

fn at_inline_comment(&self) -> bool

Whether the cursor sits at a trailing/interior // line comment: the slashes must be at a whitespace boundary (slice start or a preceding space/tab/newline) and be followed by a space or end-of-line. Code spans and @refs are already consumed atomically before the cursor gets here, so this only ever fires in the default text state.

Source

fn handle_inline_comment(&mut self)

Drop a // comment from the cursor to the end of its line: flush text up to the comment (trimming the space/tab run before //). A trailing comment resumes at the line’s \n without consuming it, so the soft break to the next line survives. A whole-line comment (only whitespace before //) also consumes that \n, so the excised line leaves no blank gap between the surrounding text lines.

Source

fn at_inline_block_comment(&self) -> bool

Whether the cursor sits at a /* block-comment opener. Unlike the // line comment, a block comment is recognized anywhere (matching the editor grammar), not just at a whitespace boundary: verbatim contexts (code spans, directive strings, raw blocks) are consumed before the cursor reaches them, and /* does not occur in URLs, so no URL-safety carve-out is needed.

Source

fn handle_inline_block_comment(&mut self)

Drop a /* … */ block comment from the cursor to its closing */: flush text up to the comment (trimming the space/tab run before /*, matching Self::handle_inline_comment), scan raw bytes across newlines for the first */, then resume just past it. An unterminated /* is a recoverable MOS0050 warning and consumes to the end of the slice.

Source

fn handle_reference(&mut self)

Source

fn push_page_reference(&mut self, id_end: usize) -> bool

Source

fn warn_stray_at(&mut self)

Source

fn handle_citation(&mut self)

Auto Trait Implementations§

§

impl<'parser, 'slice, 'src> Freeze for InlineSegmentParser<'parser, 'slice, 'src>

§

impl<'parser, 'slice, 'src> RefUnwindSafe for InlineSegmentParser<'parser, 'slice, 'src>

§

impl<'parser, 'slice, 'src> Send for InlineSegmentParser<'parser, 'slice, 'src>

§

impl<'parser, 'slice, 'src> Sync for InlineSegmentParser<'parser, 'slice, 'src>

§

impl<'parser, 'slice, 'src> Unpin for InlineSegmentParser<'parser, 'slice, 'src>

§

impl<'parser, 'slice, 'src> UnsafeUnpin for InlineSegmentParser<'parser, 'slice, 'src>

§

impl<'parser, 'slice, 'src> !UnwindSafe for InlineSegmentParser<'parser, 'slice, 'src>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.