pub struct Parser;Expand description
Parses .ought.md files into structured spec IR.
Pure Rust, no LLM dependency. Recognizes CommonMark markdown, extracts metadata, identifies bold deontic keywords, handles GIVEN nesting and OTHERWISE chains, and parses MUST BY durations.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn parse_file(path: &Path) -> Result<Spec, Vec<ParseError>>
pub fn parse_file(path: &Path) -> Result<Spec, Vec<ParseError>>
Parse a spec file from disk.
Sourcepub fn parse_string(content: &str, path: &Path) -> Result<Spec, Vec<ParseError>>
pub fn parse_string(content: &str, path: &Path) -> Result<Spec, Vec<ParseError>>
Parse a spec from a string (for testing or programmatic use).
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin 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