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

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[link]

type code_sample = str;

A code sample.

type decl_ref[link]

type decl_ref = ast::ident;

A reference to a declaration.

type doc[link]

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

A representation of a complete haredoc document.

type list[link]

type list = []paragraph;

A bulleted list.

type mod_ref[link]

type mod_ref = ast::ident;

A reference to a module.

type paragraph[link]

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

A paragraph of text.

Errors

type error[link]

type error = !lex::error;

All possible error types.

Functions

fn freeall[link]

fn freeall(doc: doc) void;

Frees resources associated with a doc.

fn parse[link]

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[link]

fn strerror(err: error) const str;

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