Skip to main content

decorate_grammar

Function decorate_grammar 

Source
pub fn decorate_grammar(
    grammar: &Grammar,
    decorators: &DecoratorSet,
    level: DecoratorLevel,
) -> Result<Grammar, DecoratorError>
Expand description

The grammar the importer or grammar-rule decorators of decorators make of grammar.

Each rule is shown as { name, kind, concept }, with format (the grammar’s source format) added at the importer level. Setting name renames the rule and every reference to it, setting kind or concept changes the rule, and drop removes it. The rules are decorated in grammar order; a grammar without decorators of the level is returned unchanged.

§Errors

A DecoratorError for an unknown rule kind or a rename the grammar refuses.