hare::parse::doc+x86_64 +linux

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);

Functions

fn freeall(doc: doc) void;
fn parse(in: io::handle, start: lex::location) (doc | lex::error);
fn strerror(err: lex::error) const str;

Types

type code_sample[permalink] [source]

type code_sample = str;

A code sample.

type decl_ref[permalink] [source]

type decl_ref = ast::ident;

A reference to a declaration.

type doc[permalink] [source]

type doc = [](paragraph | list | code_sample);

A representation of a complete haredoc document.

type list[permalink] [source]

type list = []paragraph;

A bulleted list.

type mod_ref[permalink] [source]

type mod_ref = ast::ident;

A reference to a module.

type paragraph[permalink] [source]

type paragraph = [](str | decl_ref | mod_ref);

A paragraph of text.

Functions

fn freeall[permalink] [source]

fn freeall(doc: doc) void;

Frees resources associated with a doc.

fn parse[permalink] [source]

fn parse(in: io::handle, start: lex::location) (doc | lex::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[permalink] [source]

fn strerror(err: lex::error) const str;

Converts an error into a human-friendly string. The result may be statically allocated.