pub struct Parser {}Expand description
@acp:summary “Parser for source files”
Implementations§
Source§impl Parser
impl Parser
pub fn new() -> Self
Sourcepub fn parse<P: AsRef<Path>>(&self, path: P) -> Result<ParseResult>
pub fn parse<P: AsRef<Path>>(&self, path: P) -> Result<ParseResult>
@acp:summary “Parse a source file and extract metadata”
Sourcepub fn parse_annotations(&self, content: &str) -> Vec<Annotation>
pub fn parse_annotations(&self, content: &str) -> Vec<Annotation>
@acp:summary “Parse @acp: annotations from source comments (RFC-001)” Extracts annotations with directive suffix support and multiline continuation.
Sourcepub fn parse_provenance(
&self,
lines: &[&str],
start_idx: usize,
) -> Option<ProvenanceMarker>
pub fn parse_provenance( &self, lines: &[&str], start_idx: usize, ) -> Option<ProvenanceMarker>
Parse provenance annotations from comment lines (RFC-0003)
Looks for @acp:source* annotations following the given start index. Returns a ProvenanceMarker if any provenance annotations are found.
Sourcepub fn parse_annotations_with_provenance(
&self,
content: &str,
) -> Vec<AnnotationWithProvenance>
pub fn parse_annotations_with_provenance( &self, content: &str, ) -> Vec<AnnotationWithProvenance>
Parse @acp: annotations with provenance support (RFC-0003)
Returns annotations paired with their provenance metadata if present. Provenance is detected from @acp:source* annotations following the main annotation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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> 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>
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