]> git.lizzy.rs Git - rust.git/blob - src/libsyntax/lib.rs
Auto merge of #30457 - Manishearth:rollup, r=Manishearth
[rust.git] / src / libsyntax / lib.rs
1 // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 //! The Rust parser and macro expander.
12 //!
13 //! # Note
14 //!
15 //! This API is completely unstable and subject to change.
16
17 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
18 #![cfg_attr(stage0, feature(custom_attribute))]
19 #![crate_name = "syntax"]
20 #![unstable(feature = "rustc_private", issue = "27812")]
21 #![cfg_attr(stage0, staged_api)]
22 #![crate_type = "dylib"]
23 #![crate_type = "rlib"]
24 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
25        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
26        html_root_url = "https://doc.rust-lang.org/nightly/",
27        test(attr(deny(warnings))))]
28
29 #![cfg_attr(stage0, feature(rustc_attrs))]
30 #![cfg_attr(stage0, allow(unused_attributes))]
31 #![feature(associated_consts)]
32 #![feature(filling_drop)]
33 #![feature(libc)]
34 #![feature(rustc_private)]
35 #![feature(staged_api)]
36 #![feature(str_char)]
37 #![feature(str_escape)]
38 #![feature(unicode)]
39
40 extern crate serialize;
41 extern crate term;
42 extern crate libc;
43 #[macro_use] extern crate log;
44 #[macro_use] #[no_link] extern crate rustc_bitflags;
45
46 extern crate serialize as rustc_serialize; // used by deriving
47
48 // A variant of 'try!' that panics on Err(FatalError). This is used as a
49 // crutch on the way towards a non-panic!-prone parser. It should be used
50 // for fatal parsing errors; eventually we plan to convert all code using
51 // panictry to just use normal try
52 macro_rules! panictry {
53     ($e:expr) => ({
54         use std::result::Result::{Ok, Err};
55         use errors::FatalError;
56         match $e {
57             Ok(e) => e,
58             Err(FatalError) => panic!(FatalError)
59         }
60     })
61 }
62
63 pub mod util {
64     pub mod interner;
65     pub mod lev_distance;
66     pub mod node_count;
67     pub mod parser;
68     #[cfg(test)]
69     pub mod parser_testing;
70     pub mod small_vector;
71     pub mod move_map;
72 }
73
74 pub mod diagnostics {
75     pub mod macros;
76     pub mod plugin;
77     pub mod registry;
78     pub mod metadata;
79 }
80
81 pub mod errors;
82
83 pub mod syntax {
84     pub use ext;
85     pub use parse;
86     pub use ast;
87 }
88
89 pub mod abi;
90 pub mod ast;
91 pub mod ast_util;
92 pub mod attr;
93 pub mod codemap;
94 pub mod config;
95 pub mod entry;
96 pub mod feature_gate;
97 pub mod fold;
98 pub mod owned_slice;
99 pub mod parse;
100 pub mod ptr;
101 pub mod show_span;
102 pub mod std_inject;
103 pub mod str;
104 pub mod test;
105 pub mod visit;
106
107 pub mod print {
108     pub mod pp;
109     pub mod pprust;
110 }
111
112 pub mod ext {
113     pub mod base;
114     pub mod build;
115     pub mod expand;
116     pub mod mtwt;
117     pub mod quote;
118     pub mod source_util;
119
120     pub mod tt {
121         pub mod transcribe;
122         pub mod macro_parser;
123         pub mod macro_rules;
124     }
125 }