lalrpop_util

Macro lalrpop_mod

source
macro_rules! lalrpop_mod {
    ($(#[$attr:meta])* $vis:vis $modname:ident) => { ... };
    ($(#[$attr:meta])* $vis:vis $modname:ident, $source:expr) => { ... };
}
Expand description

Define a module using the generated parse from a .lalrpop file.

You have to specify the name of the module and the path of the file generated by LALRPOP. If the input is in the root directory, you can omit it.

§Example

// load parser in src/parser.lalrpop
lalrpop_mod!(parser);

// load parser in src/lex/parser.lalrpop
lalrpop_mod!(parser, "/lex/parser.rs");

// define a public module
lalrpop_mod!(pub parser);

// specify attributes for the generated module
lalrpop_mod!(#[allow(clippy::ptr_arg)]#[rustfmt::skip] parser);