]> git.lizzy.rs Git - rust.git/blob - src/libsyntax/lib.rs
Rollup merge of #31031 - brson:issue-30123, r=nikomatsakis
[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
26 #![feature(associated_consts)]
27 #![feature(filling_drop)]
28 #![feature(libc)]
29 #![feature(rustc_private)]
30 #![feature(staged_api)]
31 #![feature(str_char)]
32 #![feature(str_escape)]
33 #![feature(unicode)]
34
35 extern crate serialize;
36 extern crate term;
37 extern crate libc;
38 #[macro_use] extern crate log;
39 #[macro_use] #[no_link] extern crate rustc_bitflags;
40
41 extern crate serialize as rustc_serialize; // used by deriving
42
43 // A variant of 'try!' that panics on an Err. This is used as a crutch on the
44 // way towards a non-panic!-prone parser. It should be used for fatal parsing
45 // errors; eventually we plan to convert all code using panictry to just use
46 // normal try.
47 // Exported for syntax_ext, not meant for general use.
48 #[macro_export]
49 macro_rules! panictry {
50     ($e:expr) => ({
51         use std::result::Result::{Ok, Err};
52         use $crate::errors::FatalError;
53         match $e {
54             Ok(e) => e,
55             Err(mut e) => {
56                 e.emit();
57                 panic!(FatalError);
58             }
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 }