🩺 doctor

Fast and flexible low level parser for JavaDoc-style doc comments.

crates.io docs.rs

Example

```rust use doctor::parse; use doctor::ast::{DocComment, Description, BodyItem, BlockTag, InlineTag};

asserteq!( parse( r#"/** * This is a doc comment. * It contains an {@inlineTag with some body} in its description. * * @blockTag1 * @blockTag2 with body text * @blockTag3 with body text and {@inlineTag} */"# ), Ok(DocComment { description: Some(Description { bodyitems: vec![ BodyItem::TextSegment("This is a doc comment.\n"), BodyItem::TextSegment("It contains an "), BodyItem::InlineTag(InlineTag { name: "inlineTag", bodylines: vec!["with some body"], }), BodyItem::TextSegment("in its description.\n"), BodyItem::TextSegment("\n"), ] }), blocktags: vec![ BlockTag { name: "blockTag1", bodyitems: vec![] }, BlockTag { name: "blockTag2", bodyitems: vec![BodyItem::TextSegment("with body text\n"),] }, BlockTag { name: "blockTag3", bodyitems: vec![ BodyItem::TextSegment("with body text and "), BodyItem::InlineTag(InlineTag { name: "inlineTag", bodylines: vec![] }), BodyItem::TextSegment("\n"), ] }, ] }) ); ``` For additional info check the documentation.

🔮 Design Goals

👯‍ Contributing

Please check the contributing documentation

License: MIT