]> git.lizzy.rs Git - rust.git/blob - src/libsyntax/lib.rs
Add test for MIR range matching.
[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 Err(FatalError). This is used as a
44 // crutch on the way towards a non-panic!-prone parser. It should be used
45 // for fatal parsing errors; eventually we plan to convert all code using
46 // panictry to just use normal try
47 macro_rules! panictry {
48     ($e:expr) => ({
49         use std::result::Result::{Ok, Err};
50         use errors::FatalError;
51         match $e {
52             Ok(e) => e,
53             Err(FatalError) => panic!(FatalError)
54         }
55     })
56 }
57
58 pub mod util {
59     pub mod interner;
60     pub mod lev_distance;
61     pub mod node_count;
62     pub mod parser;
63     #[cfg(test)]
64     pub mod parser_testing;
65     pub mod small_vector;
66     pub mod move_map;
67 }
68
69 pub mod diagnostics {
70     pub mod macros;
71     pub mod plugin;
72     pub mod registry;
73     pub mod metadata;
74 }
75
76 pub mod errors;
77
78 pub mod syntax {
79     pub use ext;
80     pub use parse;
81     pub use ast;
82 }
83
84 pub mod abi;
85 pub mod ast;
86 pub mod ast_util;
87 pub mod attr;
88 pub mod codemap;
89 pub mod config;
90 pub mod entry;
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 base;
109     pub mod build;
110     pub mod expand;
111     pub mod mtwt;
112     pub mod quote;
113     pub mod source_util;
114
115     pub mod tt {
116         pub mod transcribe;
117         pub mod macro_parser;
118         pub mod macro_rules;
119     }
120 }