diff --git a/lalrpop-util/src/lib.rs b/lalrpop-util/src/lib.rs index da3f04a..dceff85 100644 --- a/lalrpop-util/src/lib.rs +++ b/lalrpop-util/src/lib.rs @@ -143,6 +143,21 @@ pub struct ErrorRecovery { pub dropped_tokens: Vec<(L, T, L)>, } +/// 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 +/// ```no_run +/// // load parser in src/parser.lalrpop +/// lalrpop_mod!(parser); +/// +/// // load parser in src/lex/parser.lalrpop +/// lalrpop_mod!(parser, "/lex/parser.rs"); +/// ``` + #[macro_export] macro_rules! lalrpop_mod { ($modname:ident) => { lalrpop_mod!($modname, concat!("/", stringify!($modname), ".rs")); };