pub struct HereDocData {
pub content: 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 byte offset of the first character ofcontentin the source string fed into the lexer’stokenize. This lets the parser compute absolute spans for parts found inside the body during interpolation. In sources without arithmetic preprocessing rewrites, this equals the original-source offset; with arithmetic before the heredoc, line numbers may shift slightly until full preprocessing-layer composition lands.
Fields§
§content: 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
Source§fn eq(&self, other: &HereDocData) -> bool
fn eq(&self, other: &HereDocData) -> bool
Tests for
self and other values to be equal, and is used by ==.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