kproc_parser/
lib.rs

1//! kproc-parser is a minimal procedural macros parser that
2//! produce a convenient AST by including only the
3//! necessary code.
4
5// FIXME: enable be if you are including me inside
6// a nightly project.
7//#![feature(proc_macro_diagnostic)]
8mod diagnostic;
9pub mod kdiagnostic;
10pub mod kparser;
11pub mod kproc_macros;
12pub mod macros;
13pub mod rust;
14
15/// proc_macro by exporting just the correct
16/// proc_macro API.
17///
18/// This allow to inject an external `proc_macro` API
19/// like `proc_macro2`, and this is convenient for
20/// library that do not implement directly a
21/// procedural macro or avoid to include the external
22/// dependencies just to mimic the `proc_macro` API.
23///
24/// The last case is particular useful when the parser
25/// is injected inside the procedural macro code, such
26/// as the linux kernel
27pub mod proc_macro {
28    #[cfg(proc_macro_wrapper)]
29    extern crate proc_macro2 as macros;
30
31    #[cfg(any(not(proc_macro_wrapper), proc_macro))]
32    extern crate proc_macro as macros;
33
34    pub use macros::*;
35}