]> git.lizzy.rs Git - rust.git/blob - src/libsyntax/lib.rs
[breaking-change] don't pub export ast::Stmt_ variants
[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 #![crate_name = "syntax"]
18 #![unstable(feature = "rustc_private", issue = "27812")]
19 #![crate_type = "dylib"]
20 #![crate_type = "rlib"]
21 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
22        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
23        html_root_url = "https://doc.rust-lang.org/nightly/",
24        test(attr(deny(warnings))))]
25 #![cfg_attr(not(stage0), deny(warnings))]
26
27 #![feature(associated_consts)]
28 #![feature(filling_drop)]
29 #![feature(libc)]
30 #![feature(rustc_private)]
31 #![feature(staged_api)]
32 #![feature(str_char)]
33 #![feature(str_escape)]
34 #![feature(unicode)]
35
36 extern crate serialize;
37 extern crate term;
38 extern crate libc;
39 #[macro_use] extern crate log;
40 #[macro_use] #[no_link] extern crate rustc_bitflags;
41
42 extern crate serialize as rustc_serialize; // used by deriving
43
44 // A variant of 'try!' that panics on an Err. This is used as a crutch on the
45 // way towards a non-panic!-prone parser. It should be used for fatal parsing
46 // errors; eventually we plan to convert all code using panictry to just use
47 // normal try.
48 // Exported for syntax_ext, not meant for general use.
49 #[macro_export]
50 macro_rules! panictry {
51     ($e:expr) => ({
52         use std::result::Result::{Ok, Err};
53         use $crate::errors::FatalError;
54         match $e {
55             Ok(e) => e,
56             Err(mut e) => {
57                 e.emit();
58                 panic!(FatalError);
59             }
60         }
61     })
62 }
63
64 pub mod util {
65     pub mod interner;
66     pub mod lev_distance;
67     pub mod node_count;
68     pub mod parser;
69     #[cfg(test)]
70     pub mod parser_testing;
71     pub mod small_vector;
72     pub mod move_map;
73 }
74
75 pub mod diagnostics {
76     pub mod macros;
77     pub mod plugin;
78     pub mod registry;
79     pub mod metadata;
80 }
81
82 pub mod errors;
83
84 pub mod syntax {
85     pub use ext;
86     pub use parse;
87     pub use ast;
88 }
89
90 pub mod abi;
91 pub mod ast;
92 pub mod ast_util;
93 pub mod attr;
94 pub mod codemap;
95 pub mod config;
96 pub mod entry;
97 pub mod feature_gate;
98 pub mod fold;
99 pub mod owned_slice;
100 pub mod parse;
101 pub mod ptr;
102 pub mod show_span;
103 pub mod std_inject;
104 pub mod str;
105 pub mod test;
106 pub mod visit;
107
108 pub mod print {
109     pub mod pp;
110     pub mod pprust;
111 }
112
113 pub mod ext {
114     pub mod base;
115     pub mod build;
116     pub mod expand;
117     pub mod mtwt;
118     pub mod quote;
119     pub mod source_util;
120
121     pub mod tt {
122         pub mod transcribe;
123         pub mod macro_parser;
124         pub mod macro_rules;
125     }
126 }