]> git.lizzy.rs Git - rust.git/blob - src/libsyntax/lib.rs
core: Split apart the global `core` feature
[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")]
21 #![staged_api]
22 #![crate_type = "dylib"]
23 #![crate_type = "rlib"]
24 #![doc(html_logo_url = "http://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 = "http://doc.rust-lang.org/nightly/")]
27
28 #![feature(associated_consts)]
29 #![feature(collections)]
30 #![feature(collections_drain)]
31 #![feature(filling_drop)]
32 #![feature(libc)]
33 #![feature(ref_slice)]
34 #![feature(rustc_private)]
35 #![feature(staged_api)]
36 #![feature(str_char)]
37 #![feature(unicode)]
38
39 extern crate fmt_macros;
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 diagnostic::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     #[cfg(test)]
66     pub mod parser_testing;
67     pub mod small_vector;
68 }
69
70 pub mod diagnostics {
71     pub mod macros;
72     pub mod plugin;
73     pub mod registry;
74     pub mod metadata;
75 }
76
77 pub mod syntax {
78     pub use ext;
79     pub use parse;
80     pub use ast;
81 }
82
83 pub mod abi;
84 pub mod ast;
85 pub mod ast_util;
86 pub mod attr;
87 pub mod codemap;
88 pub mod config;
89 pub mod diagnostic;
90 pub mod feature_gate;
91 pub mod fold;
92 pub mod owned_slice;
93 pub mod parse;
94 pub mod ptr;
95 pub mod show_span;
96 pub mod std_inject;
97 pub mod str;
98 pub mod test;
99 pub mod visit;
100
101 pub mod print {
102     pub mod pp;
103     pub mod pprust;
104 }
105
106 pub mod ext {
107     pub mod asm;
108     pub mod base;
109     pub mod build;
110     pub mod cfg;
111     pub mod concat;
112     pub mod concat_idents;
113     pub mod deriving;
114     pub mod env;
115     pub mod expand;
116     pub mod format;
117     pub mod log_syntax;
118     pub mod mtwt;
119     pub mod quote;
120     pub mod source_util;
121     pub mod trace_macros;
122
123     pub mod tt {
124         pub mod transcribe;
125         pub mod macro_parser;
126         pub mod macro_rules;
127     }
128 }