Fix ConstExpr::Other handling
diff --git a/src/data.rs b/src/data.rs
index 7ccfd7a..3b90b1f 100644
--- a/src/data.rs
+++ b/src/data.rs
@@ -54,8 +54,12 @@
pub mod parsing {
use super::*;
use WhereClause;
+ #[cfg(feature = "full")]
+ use ConstExpr;
use attr::parsing::outer_attr;
use constant::parsing::const_expr;
+ #[cfg(feature = "full")]
+ use expr::parsing::expr;
use generics::parsing::where_clause;
use ident::parsing::ident;
use ty::parsing::{path, ty};
@@ -99,7 +103,7 @@
|
epsilon!() => { |_| VariantData::Unit }
) >>
- disr: option!(preceded!(punct!("="), const_expr)) >>
+ disr: option!(preceded!(punct!("="), discriminant)) >>
(Variant {
ident: id,
attrs: attrs,
@@ -108,6 +112,19 @@
})
));
+ #[cfg(not(feature = "full"))]
+ use self::const_expr as discriminant;
+
+ #[cfg(feature = "full")]
+ named!(discriminant -> ConstExpr, alt!(
+ terminated!(const_expr, after_discriminant)
+ |
+ terminated!(expr, after_discriminant) => { ConstExpr::Other }
+ ));
+
+ #[cfg(feature = "full")]
+ named!(after_discriminant -> &str, peek!(alt!(punct!(",") | punct!("}"))));
+
named!(pub struct_like_body -> Vec<Field>, do_parse!(
punct!("{") >>
fields: terminated_list!(punct!(","), struct_field) >>