]> git.proxmox.com Git - rustc.git/blame - src/libsyntax_expand/lib.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / libsyntax_expand / lib.rs
CommitLineData
e74abb32
XL
1#![feature(crate_visibility_modifier)]
2#![feature(decl_macro)]
3#![feature(proc_macro_diagnostic)]
4#![feature(proc_macro_internals)]
5#![feature(proc_macro_span)]
6
7extern crate proc_macro as pm;
8
9// A variant of 'try!' that panics on an Err. This is used as a crutch on the
10// way towards a non-panic!-prone parser. It should be used for fatal parsing
11// errors; eventually we plan to convert all code using panictry to just use
12// normal try.
13#[macro_export]
14macro_rules! panictry {
15 ($e:expr) => ({
16 use std::result::Result::{Ok, Err};
17 use errors::FatalError;
18 match $e {
19 Ok(e) => e,
20 Err(mut e) => {
21 e.emit();
22 FatalError.raise()
23 }
24 }
25 })
26}
27
28mod placeholders;
29mod proc_macro_server;
30
31crate use syntax_pos::hygiene;
32pub use mbe::macro_rules::compile_declarative_macro;
33pub mod base;
34pub mod build;
35pub mod expand;
60c5eb7d 36pub use rustc_parse::config;
e74abb32
XL
37pub mod proc_macro;
38
39crate mod mbe;
60c5eb7d
XL
40
41// HACK(Centril, #64197): These shouldn't really be here.
42// Rather, they should be with their respective modules which are defined in other crates.
43// However, since for now constructing a `ParseSess` sorta requires `config` from this crate,
44// these tests will need to live here in the iterim.
45
46#[cfg(test)]
47mod tests;
48#[cfg(test)]
49mod parse {
50 #[cfg(test)]
51 mod tests;
52 #[cfg(test)]
53 mod lexer {
54 #[cfg(test)]
55 mod tests;
56 }
57}
58#[cfg(test)]
59mod tokenstream {
60 #[cfg(test)]
61 mod tests;
62}
63#[cfg(test)]
64mod mut_visit {
65 #[cfg(test)]
66 mod tests;
67}