mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-03-16 17:00:53 +00:00
Explanation of the lalrpop_mod macro
This commit is contained in:
parent
7dc816b98c
commit
4640004b92
@ -143,6 +143,21 @@ pub struct ErrorRecovery<L, T, E> {
|
||||
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")); };
|
||||
|
Loading…
x
Reference in New Issue
Block a user