]> git.proxmox.com Git - rustc.git/blob - src/libsyntax/lib.rs
Imported Upstream version 1.9.0+dfsg1
[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 #![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_escape)]
33 #![feature(unicode)]
34 #![feature(question_mark)]
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 extern crate rustc_unicode;
42
43 extern crate serialize as rustc_serialize; // used by deriving
44
45 // A variant of 'try!' that panics on an Err. This is used as a crutch on the
46 // way towards a non-panic!-prone parser. It should be used for fatal parsing
47 // errors; eventually we plan to convert all code using panictry to just use
48 // normal try.
49 // Exported for syntax_ext, not meant for general use.
50 #[macro_export]
51 macro_rules! panictry {
52 ($e:expr) => ({
53 use std::result::Result::{Ok, Err};
54 use $crate::errors::FatalError;
55 match $e {
56 Ok(e) => e,
57 Err(mut e) => {
58 e.emit();
59 panic!(FatalError);
60 }
61 }
62 })
63 }
64
65 pub mod util {
66 pub mod interner;
67 pub mod lev_distance;
68 pub mod node_count;
69 pub mod parser;
70 #[cfg(test)]
71 pub mod parser_testing;
72 pub mod small_vector;
73 pub mod move_map;
74 }
75
76 pub mod diagnostics {
77 pub mod macros;
78 pub mod plugin;
79 pub mod registry;
80 pub mod metadata;
81 }
82
83 pub mod errors;
84
85 pub mod syntax {
86 pub use ext;
87 pub use parse;
88 pub use ast;
89 }
90
91 pub mod abi;
92 pub mod ast;
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 }