Structural PHPDoc comment parser.
Parses /** ... */ documentation blocks into a structured AST with accurate
spans and support for inline tags. Designed for type checkers, linters, IDEs,
and documentation generators.
The crate is agnostic — it does not interpret tag semantics or parse type
expressions. Tag bodies are exposed as raw [PhpDocText], letting tools apply
their own type parsers and validation rules.
Quick start
use parse;
let text = "/** @param int $x The value */";
let doc = parse;
assert_eq!;
assert_eq!;
Common patterns
Read a tag body
use ;
let doc = parse;
for param in find_tags
Find inline references
use ;
let doc = parse;
if let Some = &doc.description