David Tolnay | ad2836d | 2017-04-20 10:11:43 -0700 | [diff] [blame] | 1 | #![doc(html_root_url = "https://dtolnay.github.io/syn")] |
| 2 | |
David Tolnay | 02a8d47 | 2017-02-19 12:59:44 -0800 | [diff] [blame] | 3 | #![cfg_attr(feature = "cargo-clippy", allow(large_enum_variant))] |
David Tolnay | aed77b0 | 2016-09-23 20:50:31 -0700 | [diff] [blame] | 4 | |
David Tolnay | 87d0b44 | 2016-09-04 11:52:12 -0700 | [diff] [blame] | 5 | #[cfg(feature = "printing")] |
| 6 | extern crate quote; |
| 7 | |
David Tolnay | b5a7b14 | 2016-09-13 22:46:39 -0700 | [diff] [blame] | 8 | #[cfg(feature = "parsing")] |
David Tolnay | 10413f0 | 2016-09-30 09:12:02 -0700 | [diff] [blame] | 9 | extern crate unicode_xid; |
| 10 | |
| 11 | #[cfg(feature = "parsing")] |
David Tolnay | b79ee96 | 2016-09-04 09:39:20 -0700 | [diff] [blame] | 12 | #[macro_use] |
David Tolnay | 5fe14fc | 2017-01-27 16:22:08 -0800 | [diff] [blame] | 13 | extern crate synom; |
David Tolnay | 35161ff | 2016-09-03 11:33:15 -0700 | [diff] [blame] | 14 | |
David Tolnay | 631cb8c | 2016-11-10 17:16:41 -0800 | [diff] [blame] | 15 | #[cfg(feature = "aster")] |
| 16 | pub mod aster; |
David Tolnay | 886d8ea | 2016-09-13 08:34:07 -0700 | [diff] [blame] | 17 | |
David Tolnay | b79ee96 | 2016-09-04 09:39:20 -0700 | [diff] [blame] | 18 | mod attr; |
David Tolnay | b7fa2b6 | 2016-10-30 10:50:47 -0700 | [diff] [blame] | 19 | pub use attr::{Attribute, AttrStyle, MetaItem, NestedMetaItem}; |
David Tolnay | 35161ff | 2016-09-03 11:33:15 -0700 | [diff] [blame] | 20 | |
David Tolnay | 3cb23a9 | 2016-10-07 23:02:21 -0700 | [diff] [blame] | 21 | mod constant; |
| 22 | pub use constant::ConstExpr; |
| 23 | |
David Tolnay | f38cdf6 | 2016-09-23 19:07:09 -0700 | [diff] [blame] | 24 | mod data; |
David Tolnay | 3cb23a9 | 2016-10-07 23:02:21 -0700 | [diff] [blame] | 25 | pub use data::{Field, Variant, VariantData, Visibility}; |
David Tolnay | f38cdf6 | 2016-09-23 19:07:09 -0700 | [diff] [blame] | 26 | |
David Tolnay | 631cb8c | 2016-11-10 17:16:41 -0800 | [diff] [blame] | 27 | #[cfg(feature = "parsing")] |
| 28 | mod escape; |
| 29 | |
David Tolnay | f4bbbd9 | 2016-09-23 14:41:55 -0700 | [diff] [blame] | 30 | #[cfg(feature = "full")] |
| 31 | mod expr; |
| 32 | #[cfg(feature = "full")] |
David Tolnay | 05120ef | 2017-03-12 18:29:26 -0700 | [diff] [blame] | 33 | pub use expr::{Arm, BindingMode, Block, CaptureBy, Expr, ExprKind, FieldPat, FieldValue, Local, |
| 34 | MacStmtStyle, Pat, RangeLimits, Stmt}; |
David Tolnay | f4bbbd9 | 2016-09-23 14:41:55 -0700 | [diff] [blame] | 35 | |
David Tolnay | b79ee96 | 2016-09-04 09:39:20 -0700 | [diff] [blame] | 36 | mod generics; |
David Tolnay | daaf774 | 2016-10-03 11:11:43 -0700 | [diff] [blame] | 37 | pub use generics::{Generics, Lifetime, LifetimeDef, TraitBoundModifier, TyParam, TyParamBound, |
David Tolnay | fa23f57 | 2017-01-23 00:19:11 -0800 | [diff] [blame] | 38 | WhereBoundPredicate, WhereClause, WhereEqPredicate, WherePredicate, |
| 39 | WhereRegionPredicate}; |
David Tolnay | e767892 | 2016-10-13 20:44:03 -0700 | [diff] [blame] | 40 | #[cfg(feature = "printing")] |
David Tolnay | c879a50 | 2017-01-25 15:51:32 -0800 | [diff] [blame] | 41 | pub use generics::{ImplGenerics, Turbofish, TyGenerics}; |
David Tolnay | 35161ff | 2016-09-03 11:33:15 -0700 | [diff] [blame] | 42 | |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 43 | mod ident; |
David Tolnay | daaf774 | 2016-10-03 11:11:43 -0700 | [diff] [blame] | 44 | pub use ident::Ident; |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 45 | |
David Tolnay | f38cdf6 | 2016-09-23 19:07:09 -0700 | [diff] [blame] | 46 | #[cfg(feature = "full")] |
David Tolnay | b79ee96 | 2016-09-04 09:39:20 -0700 | [diff] [blame] | 47 | mod item; |
David Tolnay | f38cdf6 | 2016-09-23 19:07:09 -0700 | [diff] [blame] | 48 | #[cfg(feature = "full")] |
David Tolnay | c1fea50 | 2016-10-30 17:54:02 -0700 | [diff] [blame] | 49 | pub use item::{Constness, Defaultness, FnArg, FnDecl, ForeignItemKind, ForeignItem, ForeignMod, |
| 50 | ImplItem, ImplItemKind, ImplPolarity, Item, ItemKind, MethodSig, PathListItem, |
| 51 | TraitItem, TraitItemKind, ViewPath}; |
David Tolnay | 35161ff | 2016-09-03 11:33:15 -0700 | [diff] [blame] | 52 | |
David Tolnay | 631cb8c | 2016-11-10 17:16:41 -0800 | [diff] [blame] | 53 | #[cfg(feature = "full")] |
| 54 | mod krate; |
| 55 | #[cfg(feature = "full")] |
| 56 | pub use krate::Crate; |
| 57 | |
David Tolnay | f4bbbd9 | 2016-09-23 14:41:55 -0700 | [diff] [blame] | 58 | mod lit; |
David Tolnay | daaf774 | 2016-10-03 11:11:43 -0700 | [diff] [blame] | 59 | pub use lit::{FloatTy, IntTy, Lit, StrStyle}; |
David Tolnay | 1f16b60 | 2017-02-07 20:06:55 -0500 | [diff] [blame] | 60 | #[cfg(feature = "parsing")] |
| 61 | pub use lit::{ByteStrLit, FloatLit, IntLit, StrLit}; |
David Tolnay | f4bbbd9 | 2016-09-23 14:41:55 -0700 | [diff] [blame] | 62 | |
David Tolnay | f4bbbd9 | 2016-09-23 14:41:55 -0700 | [diff] [blame] | 63 | mod mac; |
David Tolnay | daaf774 | 2016-10-03 11:11:43 -0700 | [diff] [blame] | 64 | pub use mac::{BinOpToken, DelimToken, Delimited, Mac, Token, TokenTree}; |
David Tolnay | f4bbbd9 | 2016-09-23 14:41:55 -0700 | [diff] [blame] | 65 | |
David Tolnay | 0e83740 | 2016-12-22 17:25:55 -0500 | [diff] [blame] | 66 | mod derive; |
| 67 | pub use derive::{Body, DeriveInput}; |
David Tolnay | c28a4a5 | 2017-02-04 09:50:57 -0800 | [diff] [blame] | 68 | // Deprecated. Use `DeriveInput` instead. |
David Tolnay | 0e83740 | 2016-12-22 17:25:55 -0500 | [diff] [blame] | 69 | #[doc(hidden)] |
| 70 | pub type MacroInput = DeriveInput; |
David Tolnay | f38cdf6 | 2016-09-23 19:07:09 -0700 | [diff] [blame] | 71 | |
David Tolnay | 3cb23a9 | 2016-10-07 23:02:21 -0700 | [diff] [blame] | 72 | mod op; |
| 73 | pub use op::{BinOp, UnOp}; |
| 74 | |
David Tolnay | b79ee96 | 2016-09-04 09:39:20 -0700 | [diff] [blame] | 75 | mod ty; |
David Tolnay | b8d8ef5 | 2016-10-29 14:30:08 -0700 | [diff] [blame] | 76 | pub use ty::{Abi, AngleBracketedParameterData, BareFnArg, BareFnTy, FunctionRetTy, MutTy, |
| 77 | Mutability, ParenthesizedParameterData, Path, PathParameters, PathSegment, |
| 78 | PolyTraitRef, QSelf, Ty, TypeBinding, Unsafety}; |
David Tolnay | 35161ff | 2016-09-03 11:33:15 -0700 | [diff] [blame] | 79 | |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 80 | #[cfg(feature = "visit")] |
| 81 | pub mod visit; |
| 82 | |
gnzlbg | 9ae88d8 | 2017-01-26 20:45:17 +0100 | [diff] [blame] | 83 | #[cfg(feature = "fold")] |
| 84 | pub mod fold; |
| 85 | |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 86 | #[cfg(feature = "parsing")] |
| 87 | pub use parsing::*; |
| 88 | |
| 89 | #[cfg(feature = "parsing")] |
| 90 | mod parsing { |
Ted Driggs | 054abbb | 2017-05-01 12:20:52 -0700 | [diff] [blame] | 91 | use std::str::FromStr; |
| 92 | |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 93 | use super::*; |
Colin Kiegel | 108a7fe | 2017-03-06 13:29:57 +0100 | [diff] [blame] | 94 | use {derive, generics, ident, mac, ty, attr}; |
David Tolnay | 5fe14fc | 2017-01-27 16:22:08 -0800 | [diff] [blame] | 95 | use synom::{space, IResult}; |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 96 | |
David Tolnay | edf2b99 | 2016-09-23 20:43:45 -0700 | [diff] [blame] | 97 | #[cfg(feature = "full")] |
David Tolnay | c879a50 | 2017-01-25 15:51:32 -0800 | [diff] [blame] | 98 | use {expr, item, krate}; |
David Tolnay | edf2b99 | 2016-09-23 20:43:45 -0700 | [diff] [blame] | 99 | |
Ted Driggs | 054abbb | 2017-05-01 12:20:52 -0700 | [diff] [blame] | 100 | /// Parse the stringified representation of a struct or enum passed |
| 101 | /// to a `proc_macro_derive` function. |
David Tolnay | 0e83740 | 2016-12-22 17:25:55 -0500 | [diff] [blame] | 102 | pub fn parse_derive_input(input: &str) -> Result<DeriveInput, String> { |
| 103 | unwrap("derive input", derive::parsing::derive_input, input) |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 104 | } |
| 105 | |
David Tolnay | edf2b99 | 2016-09-23 20:43:45 -0700 | [diff] [blame] | 106 | #[cfg(feature = "full")] |
David Tolnay | 4a51dc7 | 2016-10-01 00:40:31 -0700 | [diff] [blame] | 107 | pub fn parse_crate(input: &str) -> Result<Crate, String> { |
| 108 | unwrap("crate", krate::parsing::krate, input) |
| 109 | } |
| 110 | |
| 111 | #[cfg(feature = "full")] |
David Tolnay | edf2b99 | 2016-09-23 20:43:45 -0700 | [diff] [blame] | 112 | pub fn parse_item(input: &str) -> Result<Item, String> { |
| 113 | unwrap("item", item::parsing::item, input) |
| 114 | } |
| 115 | |
David Tolnay | b9c8e32 | 2016-09-23 20:48:37 -0700 | [diff] [blame] | 116 | #[cfg(feature = "full")] |
David Tolnay | 453cfd1 | 2016-10-23 11:00:14 -0700 | [diff] [blame] | 117 | pub fn parse_items(input: &str) -> Result<Vec<Item>, String> { |
| 118 | unwrap("items", item::parsing::items, input) |
| 119 | } |
| 120 | |
| 121 | #[cfg(feature = "full")] |
David Tolnay | b9c8e32 | 2016-09-23 20:48:37 -0700 | [diff] [blame] | 122 | pub fn parse_expr(input: &str) -> Result<Expr, String> { |
| 123 | unwrap("expression", expr::parsing::expr, input) |
| 124 | } |
| 125 | |
David Tolnay | 32a112e | 2016-09-11 17:46:15 -0700 | [diff] [blame] | 126 | pub fn parse_type(input: &str) -> Result<Ty, String> { |
David Tolnay | b5a7b14 | 2016-09-13 22:46:39 -0700 | [diff] [blame] | 127 | unwrap("type", ty::parsing::ty, input) |
David Tolnay | 32a112e | 2016-09-11 17:46:15 -0700 | [diff] [blame] | 128 | } |
| 129 | |
Ted Driggs | 054abbb | 2017-05-01 12:20:52 -0700 | [diff] [blame] | 130 | /// Parse a path, such as `std::str::FromStr` or `::syn::parse_path`. |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 131 | pub fn parse_path(input: &str) -> Result<Path, String> { |
David Tolnay | b5a7b14 | 2016-09-13 22:46:39 -0700 | [diff] [blame] | 132 | unwrap("path", ty::parsing::path, input) |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | pub fn parse_where_clause(input: &str) -> Result<WhereClause, String> { |
David Tolnay | b5a7b14 | 2016-09-13 22:46:39 -0700 | [diff] [blame] | 136 | unwrap("where clause", generics::parsing::where_clause, input) |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 137 | } |
| 138 | |
Simon Sapin | 095a42b | 2016-10-20 15:54:23 +0200 | [diff] [blame] | 139 | pub fn parse_token_trees(input: &str) -> Result<Vec<TokenTree>, String> { |
| 140 | unwrap("token trees", mac::parsing::token_trees, input) |
| 141 | } |
| 142 | |
David Tolnay | a822836 | 2016-12-22 15:21:54 -0500 | [diff] [blame] | 143 | pub fn parse_ident(input: &str) -> Result<Ident, String> { |
| 144 | unwrap("identifier", ident::parsing::ident, input) |
| 145 | } |
| 146 | |
David Tolnay | 23d83f9 | 2017-01-25 15:41:47 -0800 | [diff] [blame] | 147 | pub fn parse_ty_param_bound(input: &str) -> Result<TyParamBound, String> { |
David Tolnay | 05120ef | 2017-03-12 18:29:26 -0700 | [diff] [blame] | 148 | unwrap("type parameter bound", |
| 149 | generics::parsing::ty_param_bound, |
| 150 | input) |
David Tolnay | 23d83f9 | 2017-01-25 15:41:47 -0800 | [diff] [blame] | 151 | } |
| 152 | |
Ted Driggs | 054abbb | 2017-05-01 12:20:52 -0700 | [diff] [blame] | 153 | /// Parse an attribute declared outside the item it annotates, such as |
| 154 | /// a struct annotation. They are written as `#[...]`. |
Colin Kiegel | cb72443 | 2017-03-06 12:59:18 +0100 | [diff] [blame] | 155 | pub fn parse_outer_attr(input: &str) -> Result<Attribute, String> { |
| 156 | unwrap("outer attribute", attr::parsing::outer_attr, input) |
| 157 | } |
| 158 | |
Ted Driggs | 054abbb | 2017-05-01 12:20:52 -0700 | [diff] [blame] | 159 | /// Parse an attribute declared inside the item it annotates. These are used |
| 160 | /// for crate annotations or for mod-level declarations when modules are in |
| 161 | /// their own files. They are written as `#![...]`. |
Colin Kiegel | cb72443 | 2017-03-06 12:59:18 +0100 | [diff] [blame] | 162 | #[cfg(feature = "full")] |
| 163 | pub fn parse_inner_attr(input: &str) -> Result<Attribute, String> { |
| 164 | unwrap("inner attribute", attr::parsing::inner_attr, input) |
| 165 | } |
| 166 | |
Ted Driggs | 054abbb | 2017-05-01 12:20:52 -0700 | [diff] [blame] | 167 | /// Deprecated: Use `parse_derive_input` instead. |
David Tolnay | 0e83740 | 2016-12-22 17:25:55 -0500 | [diff] [blame] | 168 | #[doc(hidden)] |
Ted Driggs | 054abbb | 2017-05-01 12:20:52 -0700 | [diff] [blame] | 169 | #[deprecated(since="0.11.0", note = "Use `parse_derive_input` instead")] |
David Tolnay | 0e83740 | 2016-12-22 17:25:55 -0500 | [diff] [blame] | 170 | pub fn parse_macro_input(input: &str) -> Result<MacroInput, String> { |
| 171 | parse_derive_input(input) |
| 172 | } |
| 173 | |
Ted Driggs | 054abbb | 2017-05-01 12:20:52 -0700 | [diff] [blame] | 174 | /// Alias for `syn::parse_derive_input`. |
| 175 | impl FromStr for DeriveInput { |
| 176 | type Err = String; |
| 177 | |
| 178 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 179 | parse_derive_input(s) |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | /// Alias for `syn::parse_crate`. |
| 184 | #[cfg(feature = "full")] |
| 185 | impl FromStr for Crate { |
| 186 | type Err = String; |
| 187 | |
| 188 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 189 | parse_crate(s) |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | /// Alias for `syn::parse_item`. |
| 194 | #[cfg(feature = "full")] |
| 195 | impl FromStr for Item { |
| 196 | type Err = String; |
| 197 | |
| 198 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 199 | parse_item(s) |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | /// Alias for `syn::parse_expr`. |
| 204 | #[cfg(feature = "full")] |
| 205 | impl FromStr for Expr { |
| 206 | type Err = String; |
| 207 | |
| 208 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 209 | parse_expr(s) |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /// Alias for `syn::parse_type`. |
| 214 | impl FromStr for Ty { |
| 215 | type Err = String; |
| 216 | |
| 217 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 218 | parse_type(s) |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | /// Alias for `syn::parse_path`. |
| 223 | impl FromStr for Path { |
| 224 | type Err = String; |
| 225 | |
| 226 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 227 | parse_path(s) |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | /// Alias for `syn::parse_where_clause`. |
| 232 | impl FromStr for WhereClause { |
| 233 | type Err = String; |
| 234 | |
| 235 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 236 | parse_where_clause(s) |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | /// Alias for `syn::parse_ident`. |
| 241 | impl FromStr for Ident { |
| 242 | type Err = String; |
| 243 | |
| 244 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 245 | parse_ident(s) |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | /// Alias for `syn::parse_ty_param_bound`. |
| 250 | impl FromStr for TyParamBound { |
| 251 | type Err = String; |
| 252 | |
| 253 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 254 | parse_ty_param_bound(s) |
| 255 | } |
| 256 | } |
| 257 | |
David Tolnay | daaf774 | 2016-10-03 11:11:43 -0700 | [diff] [blame] | 258 | fn unwrap<T>(name: &'static str, |
| 259 | f: fn(&str) -> IResult<&str, T>, |
| 260 | input: &str) |
| 261 | -> Result<T, String> { |
David Tolnay | b5a7b14 | 2016-09-13 22:46:39 -0700 | [diff] [blame] | 262 | match f(input) { |
David Tolnay | f5fdfa0 | 2016-10-23 15:25:17 -0700 | [diff] [blame] | 263 | IResult::Done(mut rest, t) => { |
David Tolnay | def6637 | 2016-10-24 21:51:32 -0700 | [diff] [blame] | 264 | rest = space::skip_whitespace(rest); |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 265 | if rest.is_empty() { |
| 266 | Ok(t) |
David Tolnay | 2e73736 | 2016-10-05 23:44:15 -0700 | [diff] [blame] | 267 | } else if rest.len() == input.len() { |
| 268 | // parsed nothing |
David Tolnay | ba8947b | 2016-10-05 23:31:12 -0700 | [diff] [blame] | 269 | Err(format!("failed to parse {}: {:?}", name, rest)) |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 270 | } else { |
David Tolnay | f2222f0 | 2017-01-27 17:09:20 -0800 | [diff] [blame] | 271 | Err(format!("unparsed tokens after {}: {:?}", name, rest)) |
David Tolnay | c94c38a | 2016-09-05 17:02:03 -0700 | [diff] [blame] | 272 | } |
David Tolnay | 5533772 | 2016-09-11 12:58:56 -0700 | [diff] [blame] | 273 | } |
David Tolnay | 14cbdeb | 2016-10-01 12:13:59 -0700 | [diff] [blame] | 274 | IResult::Error => Err(format!("failed to parse {}: {:?}", name, input)), |
David Tolnay | 35161ff | 2016-09-03 11:33:15 -0700 | [diff] [blame] | 275 | } |
David Tolnay | 35161ff | 2016-09-03 11:33:15 -0700 | [diff] [blame] | 276 | } |
| 277 | } |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 278 | |
| 279 | #[cfg(feature = "parsing")] |
David Tolnay | 5fe14fc | 2017-01-27 16:22:08 -0800 | [diff] [blame] | 280 | pub mod parse { |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 281 | //! This module contains a set of exported nom parsers which can be used to |
David Tolnay | 5fe14fc | 2017-01-27 16:22:08 -0800 | [diff] [blame] | 282 | //! parse custom grammars when used alongside the `synom` crate. |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 283 | //! |
David Tolnay | 5fe14fc | 2017-01-27 16:22:08 -0800 | [diff] [blame] | 284 | //! Internally, `syn` uses a fork of `nom` called `synom` which resolves a |
| 285 | //! persistent pitfall of using `nom` to parse Rust by eliminating the |
| 286 | //! `IResult::Incomplete` variant. The `synom` crate should be used instead |
| 287 | //! of `nom` when working with the parsers in this module. |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 288 | |
David Tolnay | 0a8972b | 2017-02-27 02:10:01 -0800 | [diff] [blame] | 289 | pub use synom::IResult; |
| 290 | |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 291 | #[cfg(feature = "full")] |
| 292 | pub use item::parsing::item; |
| 293 | |
| 294 | #[cfg(feature = "full")] |
David Tolnay | 1bf1913 | 2017-02-19 22:54:25 -0800 | [diff] [blame] | 295 | pub use expr::parsing::{expr, pat, block, stmt}; |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 296 | |
David Tolnay | 0ee4189 | 2017-02-19 22:52:59 -0800 | [diff] [blame] | 297 | pub use lit::parsing::{lit, string, byte_string, byte, character, float, int, boolean}; |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 298 | |
David Tolnay | 0ee4189 | 2017-02-19 22:52:59 -0800 | [diff] [blame] | 299 | pub use ty::parsing::{ty, path}; |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 300 | |
David Tolnay | 5fe14fc | 2017-01-27 16:22:08 -0800 | [diff] [blame] | 301 | pub use mac::parsing::token_tree as tt; |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 302 | |
| 303 | pub use ident::parsing::ident; |
David Tolnay | 1f16b60 | 2017-02-07 20:06:55 -0500 | [diff] [blame] | 304 | |
| 305 | pub use generics::parsing::lifetime; |
Michael Layzell | 5e107ff | 2017-01-24 19:58:39 -0500 | [diff] [blame] | 306 | } |