blob: e66a7e07d289a88719d56ec56b190f07a1bf5fb6 [file] [log] [blame]
David Tolnayad2836d2017-04-20 10:11:43 -07001#![doc(html_root_url = "https://dtolnay.github.io/syn")]
2
David Tolnay02a8d472017-02-19 12:59:44 -08003#![cfg_attr(feature = "cargo-clippy", allow(large_enum_variant))]
David Tolnayaed77b02016-09-23 20:50:31 -07004
Alex Crichtonccbb45d2017-05-23 10:58:24 -07005extern crate proc_macro2;
6
David Tolnay87d0b442016-09-04 11:52:12 -07007#[cfg(feature = "printing")]
8extern crate quote;
9
David Tolnayb5a7b142016-09-13 22:46:39 -070010#[cfg(feature = "parsing")]
Michael Layzell416724e2017-05-24 21:12:34 -040011extern crate relex;
David Tolnay10413f02016-09-30 09:12:02 -070012
Alex Crichtonccbb45d2017-05-23 10:58:24 -070013#[cfg_attr(feature = "parsing", macro_use)]
David Tolnay5fe14fc2017-01-27 16:22:08 -080014extern crate synom;
David Tolnay35161ff2016-09-03 11:33:15 -070015
David Tolnay631cb8c2016-11-10 17:16:41 -080016#[cfg(feature = "aster")]
17pub mod aster;
David Tolnay886d8ea2016-09-13 08:34:07 -070018
Alex Crichton62a0a592017-05-22 13:58:53 -070019#[macro_use]
20mod macros;
21
David Tolnayb79ee962016-09-04 09:39:20 -070022mod attr;
Alex Crichton62a0a592017-05-22 13:58:53 -070023pub use attr::{Attribute, AttrStyle, MetaItem, NestedMetaItem, MetaItemList,
24 MetaNameValue};
David Tolnay35161ff2016-09-03 11:33:15 -070025
David Tolnay3cb23a92016-10-07 23:02:21 -070026mod constant;
Alex Crichton62a0a592017-05-22 13:58:53 -070027pub use constant::{ConstExpr, ConstCall, ConstBinary, ConstUnary, ConstCast,
28 ConstIndex, ConstParen};
David Tolnay3cb23a92016-10-07 23:02:21 -070029
David Tolnayf38cdf62016-09-23 19:07:09 -070030mod data;
Alex Crichtonccbb45d2017-05-23 10:58:24 -070031pub use data::{Field, Variant, VariantData, Visibility, VisRestricted, VisCrate,
32 VisPublic, VisInherited};
David Tolnayf38cdf62016-09-23 19:07:09 -070033
David Tolnayf4bbbd92016-09-23 14:41:55 -070034#[cfg(feature = "full")]
35mod expr;
36#[cfg(feature = "full")]
David Tolnay05120ef2017-03-12 18:29:26 -070037pub use expr::{Arm, BindingMode, Block, CaptureBy, Expr, ExprKind, FieldPat, FieldValue, Local,
Alex Crichton62a0a592017-05-22 13:58:53 -070038 MacStmtStyle, Pat, RangeLimits, Stmt, ExprBox, ExprInPlace,
39 ExprArray, ExprCall, ExprMethodCall, ExprTup, ExprBinary, ExprUnary,
40 ExprCast, ExprType, ExprIf, ExprIfLet, ExprWhile, ExprWhileLet,
41 ExprForLoop, ExprLoop, ExprMatch, ExprClosure, ExprBlock,
42 ExprAssign, ExprAssignOp, ExprField, ExprTupField, ExprIndex,
43 ExprRange, ExprPath, ExprAddrOf, ExprBreak, ExprContinue,
Alex Crichtonccbb45d2017-05-23 10:58:24 -070044 ExprRet, ExprStruct, ExprRepeat, ExprParen, ExprTry, ExprCatch,
45 PatIdent, PatWild, PatStruct, PatTuple, PatTupleStruct, PatPath,
46 PatBox, PatRef, PatLit, PatRange, PatSlice};
David Tolnayf4bbbd92016-09-23 14:41:55 -070047
David Tolnayb79ee962016-09-04 09:39:20 -070048mod generics;
David Tolnaydaaf7742016-10-03 11:11:43 -070049pub use generics::{Generics, Lifetime, LifetimeDef, TraitBoundModifier, TyParam, TyParamBound,
David Tolnayfa23f572017-01-23 00:19:11 -080050 WhereBoundPredicate, WhereClause, WhereEqPredicate, WherePredicate,
Alex Crichtonccbb45d2017-05-23 10:58:24 -070051 WhereRegionPredicate, BoundLifetimes};
David Tolnaye7678922016-10-13 20:44:03 -070052#[cfg(feature = "printing")]
David Tolnayc879a502017-01-25 15:51:32 -080053pub use generics::{ImplGenerics, Turbofish, TyGenerics};
David Tolnay35161ff2016-09-03 11:33:15 -070054
David Tolnay55337722016-09-11 12:58:56 -070055mod ident;
David Tolnaydaaf7742016-10-03 11:11:43 -070056pub use ident::Ident;
David Tolnay55337722016-09-11 12:58:56 -070057
David Tolnayf38cdf62016-09-23 19:07:09 -070058#[cfg(feature = "full")]
David Tolnayb79ee962016-09-04 09:39:20 -070059mod item;
David Tolnayf38cdf62016-09-23 19:07:09 -070060#[cfg(feature = "full")]
Alex Crichton62a0a592017-05-22 13:58:53 -070061pub use item::{Constness, Defaultness, FnArg, FnDecl, ForeignItemKind, ForeignItem, ItemForeignMod,
David Tolnayc1fea502016-10-30 17:54:02 -070062 ImplItem, ImplItemKind, ImplPolarity, Item, ItemKind, MethodSig, PathListItem,
Alex Crichton62a0a592017-05-22 13:58:53 -070063 TraitItem, TraitItemKind, ViewPath, ItemExternCrate, ItemUse,
64 ItemStatic, ItemConst, ItemFn, ItemMod, ItemTy, ItemEnum,
65 ItemStruct, ItemUnion, ItemTrait, ItemDefaultImpl, ItemImpl,
66 PathSimple, PathGlob, PathList, ForeignItemFn, ForeignItemStatic,
67 TraitItemConst, TraitItemMethod, TraitItemType,
68 ImplItemConst, ImplItemMethod, ImplItemType, ArgSelfRef,
69 ArgSelf, ArgCaptured};
David Tolnay35161ff2016-09-03 11:33:15 -070070
David Tolnay631cb8c2016-11-10 17:16:41 -080071#[cfg(feature = "full")]
72mod krate;
73#[cfg(feature = "full")]
74pub use krate::Crate;
75
David Tolnayf4bbbd92016-09-23 14:41:55 -070076mod lit;
Alex Crichtonccbb45d2017-05-23 10:58:24 -070077pub use lit::{Lit, LitKind};
David Tolnayf4bbbd92016-09-23 14:41:55 -070078
David Tolnayf4bbbd92016-09-23 14:41:55 -070079mod mac;
Alex Crichtonccbb45d2017-05-23 10:58:24 -070080pub use mac::{Mac, TokenTree};
David Tolnayf4bbbd92016-09-23 14:41:55 -070081
David Tolnay0e837402016-12-22 17:25:55 -050082mod derive;
Alex Crichtonccbb45d2017-05-23 10:58:24 -070083pub use derive::{Body, DeriveInput, BodyEnum, BodyStruct};
David Tolnayc28a4a52017-02-04 09:50:57 -080084// Deprecated. Use `DeriveInput` instead.
David Tolnay0e837402016-12-22 17:25:55 -050085#[doc(hidden)]
86pub type MacroInput = DeriveInput;
David Tolnayf38cdf62016-09-23 19:07:09 -070087
David Tolnay3cb23a92016-10-07 23:02:21 -070088mod op;
89pub use op::{BinOp, UnOp};
90
David Tolnayb79ee962016-09-04 09:39:20 -070091mod ty;
David Tolnayb8d8ef52016-10-29 14:30:08 -070092pub use ty::{Abi, AngleBracketedParameterData, BareFnArg, BareFnTy, FunctionRetTy, MutTy,
93 Mutability, ParenthesizedParameterData, Path, PathParameters, PathSegment,
Alex Crichton62a0a592017-05-22 13:58:53 -070094 PolyTraitRef, QSelf, Ty, TypeBinding, Unsafety, TySlice, TyArray,
95 TyPtr, TyRptr, TyBareFn, TyNever, TyTup, TyPath, TyTraitObject,
96 TyImplTrait, TyParen, TyInfer};
Alex Crichtonccbb45d2017-05-23 10:58:24 -070097#[cfg(feature = "printing")]
98pub use ty::PathTokens;
99
100mod span;
101pub use span::Span;
102
103pub mod tokens;
104pub use synom::delimited;
David Tolnay35161ff2016-09-03 11:33:15 -0700105
David Tolnay55337722016-09-11 12:58:56 -0700106#[cfg(feature = "visit")]
107pub mod visit;
108
gnzlbg9ae88d82017-01-26 20:45:17 +0100109#[cfg(feature = "fold")]
110pub mod fold;
111
David Tolnay55337722016-09-11 12:58:56 -0700112#[cfg(feature = "parsing")]
113pub use parsing::*;
114
115#[cfg(feature = "parsing")]
116mod parsing {
Ted Driggs054abbb2017-05-01 12:20:52 -0700117 use std::str::FromStr;
118
David Tolnay55337722016-09-11 12:58:56 -0700119 use super::*;
Colin Kiegel108a7fe2017-03-06 13:29:57 +0100120 use {derive, generics, ident, mac, ty, attr};
Michael Layzell416724e2017-05-24 21:12:34 -0400121 use synom::{IResult, TokenStream};
122
123 use std::convert::From;
124 use std::error::Error;
125 use std::fmt;
David Tolnay55337722016-09-11 12:58:56 -0700126
David Tolnayedf2b992016-09-23 20:43:45 -0700127 #[cfg(feature = "full")]
David Tolnayc879a502017-01-25 15:51:32 -0800128 use {expr, item, krate};
David Tolnayedf2b992016-09-23 20:43:45 -0700129
Michael Layzell416724e2017-05-24 21:12:34 -0400130 #[derive(Debug)]
131 pub struct ParseError(String);
132
133 impl Error for ParseError {
134 fn description(&self) -> &str {
135 &self.0
136 }
137 }
138
139 impl fmt::Display for ParseError {
140 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
141 <String as fmt::Display>::fmt(&self.0, f)
142 }
143 }
144
145 impl From<synom::LexError> for ParseError {
146 fn from(_: synom::LexError) -> ParseError {
147 ParseError("error while lexing input string".to_owned())
148 }
149 }
150
Ted Driggs054abbb2017-05-01 12:20:52 -0700151 /// Parse the stringified representation of a struct or enum passed
152 /// to a `proc_macro_derive` function.
Michael Layzell416724e2017-05-24 21:12:34 -0400153 pub fn parse_derive_input(input: TokenStream) -> Result<DeriveInput, ParseError> {
David Tolnay0e837402016-12-22 17:25:55 -0500154 unwrap("derive input", derive::parsing::derive_input, input)
David Tolnay55337722016-09-11 12:58:56 -0700155 }
156
Michael Layzell416724e2017-05-24 21:12:34 -0400157 /// Parse an entire crate into an AST. This function takes a string as input
158 /// instead of a TokenStream, as we need to handle parsing the BOM and
159 /// shebang from the string.
David Tolnayedf2b992016-09-23 20:43:45 -0700160 #[cfg(feature = "full")]
Michael Layzell416724e2017-05-24 21:12:34 -0400161 pub fn parse_crate(mut input: &str) -> Result<Crate, ParseError> {
162 // Strip the BOM if it is present
163 const BOM: &str = "\u{feff}";
164 if input.starts_with(BOM) {
165 input = &input[BOM.len()..];
166 }
167
168 let mut shebang = None;
169 if input.starts_with("#!") && !input.starts_with("#![") {
170 if let Some(idx) = input.find('\n') {
171 shebang = Some(input[..idx].to_string());
172 input = &input[idx..];
173 } else {
174 shebang = Some(input.to_string());
175 input = "";
176 }
177 }
178
179 let mut krate = unwrap("crate", krate::parsing::krate,
180 input.parse()?)?;
181 krate.shebang = shebang;
182 Ok(krate)
183
David Tolnay4a51dc72016-10-01 00:40:31 -0700184 }
185
186 #[cfg(feature = "full")]
Michael Layzell416724e2017-05-24 21:12:34 -0400187 pub fn parse_item(input: TokenStream) -> Result<Item, ParseError> {
David Tolnayedf2b992016-09-23 20:43:45 -0700188 unwrap("item", item::parsing::item, input)
189 }
190
David Tolnayb9c8e322016-09-23 20:48:37 -0700191 #[cfg(feature = "full")]
Michael Layzell416724e2017-05-24 21:12:34 -0400192 pub fn parse_items(input: TokenStream) -> Result<Vec<Item>, ParseError> {
David Tolnay453cfd12016-10-23 11:00:14 -0700193 unwrap("items", item::parsing::items, input)
194 }
195
196 #[cfg(feature = "full")]
Michael Layzell416724e2017-05-24 21:12:34 -0400197 pub fn parse_expr(input: TokenStream) -> Result<Expr, ParseError> {
David Tolnayb9c8e322016-09-23 20:48:37 -0700198 unwrap("expression", expr::parsing::expr, input)
199 }
200
Michael Layzell416724e2017-05-24 21:12:34 -0400201 pub fn parse_type(input: TokenStream) -> Result<Ty, ParseError> {
David Tolnayb5a7b142016-09-13 22:46:39 -0700202 unwrap("type", ty::parsing::ty, input)
David Tolnay32a112e2016-09-11 17:46:15 -0700203 }
204
Ted Driggs054abbb2017-05-01 12:20:52 -0700205 /// Parse a path, such as `std::str::FromStr` or `::syn::parse_path`.
Michael Layzell416724e2017-05-24 21:12:34 -0400206 pub fn parse_path(input: TokenStream) -> Result<Path, ParseError> {
David Tolnayb5a7b142016-09-13 22:46:39 -0700207 unwrap("path", ty::parsing::path, input)
David Tolnay55337722016-09-11 12:58:56 -0700208 }
209
Michael Layzell416724e2017-05-24 21:12:34 -0400210 pub fn parse_where_clause(input: TokenStream) -> Result<WhereClause, ParseError> {
David Tolnayb5a7b142016-09-13 22:46:39 -0700211 unwrap("where clause", generics::parsing::where_clause, input)
David Tolnay55337722016-09-11 12:58:56 -0700212 }
213
Michael Layzell416724e2017-05-24 21:12:34 -0400214 pub fn parse_token_trees(input: TokenStream) -> Result<Vec<TokenTree>, ParseError> {
Simon Sapin095a42b2016-10-20 15:54:23 +0200215 unwrap("token trees", mac::parsing::token_trees, input)
216 }
217
Michael Layzell416724e2017-05-24 21:12:34 -0400218 pub fn parse_ident(input: TokenStream) -> Result<Ident, ParseError> {
David Tolnaya8228362016-12-22 15:21:54 -0500219 unwrap("identifier", ident::parsing::ident, input)
220 }
221
Michael Layzell416724e2017-05-24 21:12:34 -0400222 pub fn parse_ty_param_bound(input: TokenStream) -> Result<TyParamBound, ParseError> {
David Tolnay05120ef2017-03-12 18:29:26 -0700223 unwrap("type parameter bound",
224 generics::parsing::ty_param_bound,
225 input)
David Tolnay23d83f92017-01-25 15:41:47 -0800226 }
227
Ted Driggs054abbb2017-05-01 12:20:52 -0700228 /// Parse an attribute declared outside the item it annotates, such as
229 /// a struct annotation. They are written as `#[...]`.
Michael Layzell416724e2017-05-24 21:12:34 -0400230 pub fn parse_outer_attr(input: TokenStream) -> Result<Attribute, ParseError> {
Colin Kiegelcb724432017-03-06 12:59:18 +0100231 unwrap("outer attribute", attr::parsing::outer_attr, input)
232 }
233
Ted Driggs054abbb2017-05-01 12:20:52 -0700234 /// Parse an attribute declared inside the item it annotates. These are used
235 /// for crate annotations or for mod-level declarations when modules are in
236 /// their own files. They are written as `#![...]`.
Colin Kiegelcb724432017-03-06 12:59:18 +0100237 #[cfg(feature = "full")]
Michael Layzell416724e2017-05-24 21:12:34 -0400238 pub fn parse_inner_attr(input: TokenStream) -> Result<Attribute, ParseError> {
Colin Kiegelcb724432017-03-06 12:59:18 +0100239 unwrap("inner attribute", attr::parsing::inner_attr, input)
240 }
241
Ted Driggs054abbb2017-05-01 12:20:52 -0700242 /// Deprecated: Use `parse_derive_input` instead.
David Tolnay0e837402016-12-22 17:25:55 -0500243 #[doc(hidden)]
Ted Driggs054abbb2017-05-01 12:20:52 -0700244 #[deprecated(since="0.11.0", note = "Use `parse_derive_input` instead")]
Michael Layzell416724e2017-05-24 21:12:34 -0400245 pub fn parse_macro_input(input: TokenStream) -> Result<MacroInput, ParseError> {
David Tolnay0e837402016-12-22 17:25:55 -0500246 parse_derive_input(input)
247 }
248
Ted Driggs054abbb2017-05-01 12:20:52 -0700249 /// Alias for `syn::parse_derive_input`.
250 impl FromStr for DeriveInput {
Michael Layzell416724e2017-05-24 21:12:34 -0400251 type Err = ParseError;
Ted Driggs054abbb2017-05-01 12:20:52 -0700252
253 fn from_str(s: &str) -> Result<Self, Self::Err> {
Michael Layzell416724e2017-05-24 21:12:34 -0400254 parse_derive_input(s.parse()?)
Ted Driggs054abbb2017-05-01 12:20:52 -0700255 }
256 }
257
258 /// Alias for `syn::parse_crate`.
259 #[cfg(feature = "full")]
260 impl FromStr for Crate {
Michael Layzell416724e2017-05-24 21:12:34 -0400261 type Err = ParseError;
Ted Driggs054abbb2017-05-01 12:20:52 -0700262
263 fn from_str(s: &str) -> Result<Self, Self::Err> {
264 parse_crate(s)
265 }
266 }
267
268 /// Alias for `syn::parse_item`.
269 #[cfg(feature = "full")]
270 impl FromStr for Item {
Michael Layzell416724e2017-05-24 21:12:34 -0400271 type Err = ParseError;
Ted Driggs054abbb2017-05-01 12:20:52 -0700272
273 fn from_str(s: &str) -> Result<Self, Self::Err> {
Michael Layzell416724e2017-05-24 21:12:34 -0400274 parse_item(s.parse()?)
Ted Driggs054abbb2017-05-01 12:20:52 -0700275 }
276 }
277
278 /// Alias for `syn::parse_expr`.
279 #[cfg(feature = "full")]
280 impl FromStr for Expr {
Michael Layzell416724e2017-05-24 21:12:34 -0400281 type Err = ParseError;
Ted Driggs054abbb2017-05-01 12:20:52 -0700282
283 fn from_str(s: &str) -> Result<Self, Self::Err> {
Michael Layzell416724e2017-05-24 21:12:34 -0400284 parse_expr(s.parse()?)
Ted Driggs054abbb2017-05-01 12:20:52 -0700285 }
286 }
287
288 /// Alias for `syn::parse_type`.
289 impl FromStr for Ty {
Michael Layzell416724e2017-05-24 21:12:34 -0400290 type Err = ParseError;
Ted Driggs054abbb2017-05-01 12:20:52 -0700291
292 fn from_str(s: &str) -> Result<Self, Self::Err> {
Michael Layzell416724e2017-05-24 21:12:34 -0400293 parse_type(s.parse()?)
Ted Driggs054abbb2017-05-01 12:20:52 -0700294 }
295 }
296
297 /// Alias for `syn::parse_path`.
298 impl FromStr for Path {
Michael Layzell416724e2017-05-24 21:12:34 -0400299 type Err = ParseError;
Ted Driggs054abbb2017-05-01 12:20:52 -0700300
301 fn from_str(s: &str) -> Result<Self, Self::Err> {
Michael Layzell416724e2017-05-24 21:12:34 -0400302 parse_path(s.parse()?)
Ted Driggs054abbb2017-05-01 12:20:52 -0700303 }
304 }
305
306 /// Alias for `syn::parse_where_clause`.
307 impl FromStr for WhereClause {
Michael Layzell416724e2017-05-24 21:12:34 -0400308 type Err = ParseError;
Ted Driggs054abbb2017-05-01 12:20:52 -0700309
310 fn from_str(s: &str) -> Result<Self, Self::Err> {
Michael Layzell416724e2017-05-24 21:12:34 -0400311 parse_where_clause(s.parse()?)
Ted Driggs054abbb2017-05-01 12:20:52 -0700312 }
313 }
314
315 /// Alias for `syn::parse_ident`.
316 impl FromStr for Ident {
Michael Layzell416724e2017-05-24 21:12:34 -0400317 type Err = ParseError;
Ted Driggs054abbb2017-05-01 12:20:52 -0700318
319 fn from_str(s: &str) -> Result<Self, Self::Err> {
Michael Layzell416724e2017-05-24 21:12:34 -0400320 parse_ident(s.parse()?)
Ted Driggs054abbb2017-05-01 12:20:52 -0700321 }
322 }
323
324 /// Alias for `syn::parse_ty_param_bound`.
325 impl FromStr for TyParamBound {
Michael Layzell416724e2017-05-24 21:12:34 -0400326 type Err = ParseError;
Ted Driggs054abbb2017-05-01 12:20:52 -0700327
328 fn from_str(s: &str) -> Result<Self, Self::Err> {
Michael Layzell416724e2017-05-24 21:12:34 -0400329 parse_ty_param_bound(s.parse()?)
Ted Driggs054abbb2017-05-01 12:20:52 -0700330 }
331 }
332
David Tolnaydaaf7742016-10-03 11:11:43 -0700333 fn unwrap<T>(name: &'static str,
Michael Layzell416724e2017-05-24 21:12:34 -0400334 f: fn(&[synom::TokenTree]) -> IResult<&[synom::TokenTree], T>,
335 input: TokenStream)
336 -> Result<T, ParseError> {
337 let input = synom::InputBuf::new(input);
338 match f(&input) {
339 IResult::Done(rest, t) => {
David Tolnay55337722016-09-11 12:58:56 -0700340 if rest.is_empty() {
341 Ok(t)
David Tolnay2e737362016-10-05 23:44:15 -0700342 } else if rest.len() == input.len() {
343 // parsed nothing
Michael Layzell416724e2017-05-24 21:12:34 -0400344 Err(ParseError(format!("failed to parse {}", name)))
David Tolnay55337722016-09-11 12:58:56 -0700345 } else {
Michael Layzell416724e2017-05-24 21:12:34 -0400346 Err(ParseError(format!("unparsed tokens after {}", name)))
David Tolnayc94c38a2016-09-05 17:02:03 -0700347 }
David Tolnay55337722016-09-11 12:58:56 -0700348 }
Michael Layzell416724e2017-05-24 21:12:34 -0400349 IResult::Error => Err(ParseError(format!("failed to parse {}", name))),
David Tolnay35161ff2016-09-03 11:33:15 -0700350 }
David Tolnay35161ff2016-09-03 11:33:15 -0700351 }
352}
Michael Layzell5e107ff2017-01-24 19:58:39 -0500353
354#[cfg(feature = "parsing")]
David Tolnay5fe14fc2017-01-27 16:22:08 -0800355pub mod parse {
Michael Layzell5e107ff2017-01-24 19:58:39 -0500356 //! This module contains a set of exported nom parsers which can be used to
David Tolnay5fe14fc2017-01-27 16:22:08 -0800357 //! parse custom grammars when used alongside the `synom` crate.
Michael Layzell5e107ff2017-01-24 19:58:39 -0500358 //!
David Tolnay5fe14fc2017-01-27 16:22:08 -0800359 //! Internally, `syn` uses a fork of `nom` called `synom` which resolves a
360 //! persistent pitfall of using `nom` to parse Rust by eliminating the
361 //! `IResult::Incomplete` variant. The `synom` crate should be used instead
362 //! of `nom` when working with the parsers in this module.
Michael Layzell5e107ff2017-01-24 19:58:39 -0500363
David Tolnay0a8972b2017-02-27 02:10:01 -0800364 pub use synom::IResult;
365
Michael Layzell5e107ff2017-01-24 19:58:39 -0500366 #[cfg(feature = "full")]
367 pub use item::parsing::item;
368
369 #[cfg(feature = "full")]
David Tolnay1bf19132017-02-19 22:54:25 -0800370 pub use expr::parsing::{expr, pat, block, stmt};
Michael Layzell5e107ff2017-01-24 19:58:39 -0500371
David Tolnay0ee41892017-02-19 22:52:59 -0800372 pub use lit::parsing::{lit, string, byte_string, byte, character, float, int, boolean};
Michael Layzell5e107ff2017-01-24 19:58:39 -0500373
David Tolnay0ee41892017-02-19 22:52:59 -0800374 pub use ty::parsing::{ty, path};
Michael Layzell5e107ff2017-01-24 19:58:39 -0500375
David Tolnay5fe14fc2017-01-27 16:22:08 -0800376 pub use mac::parsing::token_tree as tt;
Michael Layzell5e107ff2017-01-24 19:58:39 -0500377
378 pub use ident::parsing::ident;
David Tolnay1f16b602017-02-07 20:06:55 -0500379
380 pub use generics::parsing::lifetime;
Michael Layzell5e107ff2017-01-24 19:58:39 -0500381}