]>
Commit | Line | Data |
---|---|---|
223e47cc LB |
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 | ||
1a4d82fc JJ |
11 | //! The Rust parser and macro expander. |
12 | //! | |
13 | //! # Note | |
14 | //! | |
15 | //! This API is completely unstable and subject to change. | |
16 | ||
c34b1796 AL |
17 | // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364) |
18 | #![cfg_attr(stage0, feature(custom_attribute))] | |
1a4d82fc | 19 | #![crate_name = "syntax"] |
85aaf69f | 20 | #![unstable(feature = "rustc_private")] |
1a4d82fc JJ |
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 = "http://www.rust-lang.org/favicon.ico", | |
26 | html_root_url = "http://doc.rust-lang.org/nightly/")] | |
27 | ||
d9579d0f | 28 | #![feature(associated_consts)] |
85aaf69f | 29 | #![feature(collections)] |
d9579d0f | 30 | #![feature(collections_drain)] |
85aaf69f | 31 | #![feature(core)] |
85aaf69f | 32 | #![feature(libc)] |
85aaf69f SL |
33 | #![feature(rustc_private)] |
34 | #![feature(staged_api)] | |
c34b1796 | 35 | #![feature(str_char)] |
d9579d0f | 36 | #![feature(unicode)] |
1a4d82fc JJ |
37 | |
38 | extern crate arena; | |
39 | extern crate fmt_macros; | |
40 | extern crate serialize; | |
41 | extern crate term; | |
42 | extern crate libc; | |
43 | #[macro_use] extern crate log; | |
85aaf69f | 44 | #[macro_use] #[no_link] extern crate rustc_bitflags; |
1a4d82fc | 45 | |
c34b1796 | 46 | extern crate serialize as rustc_serialize; // used by deriving |
223e47cc | 47 | |
9346a6ac AL |
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 | ||
970d7e83 LB |
63 | pub mod util { |
64 | pub mod interner; | |
65 | #[cfg(test)] | |
66 | pub mod parser_testing; | |
1a4d82fc JJ |
67 | pub mod small_vector; |
68 | } | |
69 | ||
70 | pub mod diagnostics { | |
71 | pub mod macros; | |
72 | pub mod plugin; | |
73 | pub mod registry; | |
d9579d0f | 74 | pub mod metadata; |
970d7e83 | 75 | } |
223e47cc LB |
76 | |
77 | pub mod syntax { | |
78 | pub use ext; | |
79 | pub use parse; | |
1a4d82fc | 80 | pub use ast; |
223e47cc LB |
81 | } |
82 | ||
223e47cc LB |
83 | pub mod abi; |
84 | pub mod ast; | |
223e47cc | 85 | pub mod ast_map; |
1a4d82fc JJ |
86 | pub mod ast_util; |
87 | pub mod attr; | |
88 | pub mod codemap; | |
89 | pub mod config; | |
90 | pub mod diagnostic; | |
91 | pub mod feature_gate; | |
223e47cc | 92 | pub mod fold; |
1a4d82fc | 93 | pub mod owned_slice; |
223e47cc | 94 | pub mod parse; |
1a4d82fc JJ |
95 | pub mod ptr; |
96 | pub mod show_span; | |
97 | pub mod std_inject; | |
d9579d0f | 98 | pub mod str; |
1a4d82fc JJ |
99 | pub mod test; |
100 | pub mod visit; | |
223e47cc LB |
101 | |
102 | pub mod print { | |
103 | pub mod pp; | |
104 | pub mod pprust; | |
105 | } | |
106 | ||
107 | pub mod ext { | |
108 | pub mod asm; | |
109 | pub mod base; | |
1a4d82fc JJ |
110 | pub mod build; |
111 | pub mod cfg; | |
1a4d82fc JJ |
112 | pub mod concat; |
113 | pub mod concat_idents; | |
114 | pub mod deriving; | |
115 | pub mod env; | |
223e47cc | 116 | pub mod expand; |
1a4d82fc JJ |
117 | pub mod format; |
118 | pub mod log_syntax; | |
119 | pub mod mtwt; | |
223e47cc | 120 | pub mod quote; |
1a4d82fc JJ |
121 | pub mod source_util; |
122 | pub mod trace_macros; | |
223e47cc LB |
123 | |
124 | pub mod tt { | |
125 | pub mod transcribe; | |
126 | pub mod macro_parser; | |
127 | pub mod macro_rules; | |
128 | } | |
223e47cc | 129 | } |