]> git.proxmox.com Git - rustc.git/blob - src/libsyntax/lib.rs
330fe86deeb37e43d3e4ef10f1d39c574223c1a0
[rustc.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 = "http://www.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(core)]
32 #![feature(libc)]
33 #![feature(rustc_private)]
34 #![feature(staged_api)]
35 #![feature(str_char)]
36 #![feature(unicode)]
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;
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_map;
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;
92 pub mod fold;
93 pub mod owned_slice;
94 pub mod parse;
95 pub mod ptr;
96 pub mod show_span;
97 pub mod std_inject;
98 pub mod str;
99 pub mod test;
100 pub mod visit;
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;
110 pub mod build;
111 pub mod cfg;
112 pub mod concat;
113 pub mod concat_idents;
114 pub mod deriving;
115 pub mod env;
116 pub mod expand;
117 pub mod format;
118 pub mod log_syntax;
119 pub mod mtwt;
120 pub mod quote;
121 pub mod source_util;
122 pub mod trace_macros;
123
124 pub mod tt {
125 pub mod transcribe;
126 pub mod macro_parser;
127 pub mod macro_rules;
128 }
129 }