Skip to main content

parse_tl_file

Function parse_tl_file 

Source
pub fn parse_tl_file(
    contents: &str,
) -> impl Iterator<Item = Result<Definition, ParseError>> + '_
Expand description

Parses a complete TL schema file, yielding Definitions one by one.

Lines starting with // are treated as comments and skipped. The special ---functions--- and ---types--- section markers switch the tl::Category applied to the following definitions.

Returns an iterator of Result<Definition, ParseError> so callers can decide whether to skip or hard-fail on bad lines.