Skip to main content

read_balanced

Function read_balanced 

Source
pub fn read_balanced(
    expansion_level: ExpansionLevel,
    is_macrodef: bool,
    require_open: bool,
) -> Result<Tokens>
Expand description

Approximates TeX’s scan_toks (but doesn’t parse \def parameter lists) and only optionally requires the openning “{”.

It may return comments in the token lists. The is_macrodef flag affects whether # parameters are “packed” for macro bodies. If require_open is true, the opening T_BEGIN has not yet been read, and is required.

If toplevel is true, it will automatically close empty mouths as it reads, and will also fully expand macros (unless overridden by expansion_level being explicitly Off).