pub struct HereDocData {
pub content: String,
pub source_body: String,
pub delimiter: String,
pub literal: bool,
pub strip_tabs: bool,
pub body_start_offset: usize,
}Expand description
Tokens produced by the kaish lexer.
The order of variants matters for logos priority. More specific patterns (like keywords) should come before more general ones (like identifiers).
Tokens that carry semantic values (strings, numbers, identifiers) include the parsed value directly. This ensures the parser has access to actual data, not just token types. Here-doc content data.
literalis true when the delimiter was quoted (<<'EOF'or<<"EOF"), meaning no variable expansion should occur.strip_tabsis true for the<<-EOFform. Per POSIX, leading tabs on each body line are stripped at materialization time. Stripping happens downstream of the parser so byte offsets incontentstay aligned with their original-source positions for span-tracking purposes.body_start_offsetis the exact byte offset of the first character ofcontentin the original source passed totokenize. This lets the parser compute absolute spans for parts found inside the body during interpolation. (For interpolated bodies containing$((..)), spans of parts AFTER the rewritten expression drift by the rewrite’s length difference — the body-local${__ARITH:expr__}form is longer than the source text; seerewrite_body_arithmetic.)delimiteris the word as written with its quotes removed (PYfor both<<PYand<<'PY'), kept because it is the language hint the author chose and a plan publishes it.source_bodyis the body exactly as it appears in the source. It differs fromcontentonly for an interpolated body containing$((…)), whichcontentcarries in the rewritten${__ARITH:…}form — a kernel-internal spelling that must never reach a plan.
Fields§
§content: String§source_body: String§delimiter: String§literal: bool§strip_tabs: bool§body_start_offset: usizeTrait Implementations§
Source§impl Clone for HereDocData
impl Clone for HereDocData
Source§fn clone(&self) -> HereDocData
fn clone(&self) -> HereDocData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HereDocData
impl Debug for HereDocData
Source§impl PartialEq for HereDocData
impl PartialEq for HereDocData
impl StructuralPartialEq for HereDocData
Auto Trait Implementations§
impl Freeze for HereDocData
impl RefUnwindSafe for HereDocData
impl Send for HereDocData
impl Sync for HereDocData
impl Unpin for HereDocData
impl UnsafeUnpin for HereDocData
impl UnwindSafe for HereDocData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.