hare::parse::doc
hare::parse::doc parses haredoc markup into an abstract representation. The haredoc markup format is documented in haredoc(5).
Index
Types
type code_sample = str;
type decl_ref = ast::ident;
type doc = [](paragraph | list | code_sample);
type list = []paragraph;
type mod_ref = ast::ident;
type paragraph = [](str | decl_ref | mod_ref);
Errors
type error = !lex::error;
Functions
fn freeall(doc: doc) void;
fn parse(in: io::handle, start: lex::location) (doc | error);
fn strerror(err: error) const str;
Types
type code_sample
type code_sample = str;
A code sample.
type decl_ref
type decl_ref = ast::ident;
A reference to a declaration.
type doc
type doc = [](paragraph | list | code_sample);
A representation of a complete haredoc document.
type list
type list = []paragraph;
A bulleted list.
type mod_ref
type mod_ref = ast::ident;
A reference to a module.
type paragraph
type paragraph = [](str | decl_ref | mod_ref);
A paragraph of text.
Errors
type error
type error = !lex::error;
All possible error types.
Functions
fn freeall
fn freeall(doc: doc) void;
Frees resources associated with a doc.
fn parse
fn parse(in: io::handle, start: lex::location) (doc | error);
Parses a haredoc document from an io::handle. 'start' is the location of the top-left corner of the document, for accurate locations in error messages (e.g. declaration documentation starts at col=3; READMEs start at col=1).
fn strerror
fn strerror(err: error) const str;
Converts an error into a human-friendly string. The result may be statically allocated.