Comments (2)
Sorry for the slow response - I am on vacation this week without internet access. This will be my highest priority when I get back on Friday, unless someone has a PR ready by then.
from syn.
I fixed this in 0.6.0. Variant
s now have an optional discriminant
field so your example looks like this:
enum Foo {
A = 1,
B = 2,
C
}
MacroInput {
ident: "Foo".into(),
vis: Visibility::Inherited,
attrs: vec![],
generics: Generics::default(),
body: Body::Enum(vec![
Variant {
ident: "A".into(),
attrs: vec![],
data: VariantData::Unit,
discriminant: Some(Discriminant {
value: 1,
ty: IntTy::Unsuffixed,
}),
},
Variant {
ident: "B".into(),
attrs: vec![],
data: VariantData::Unit,
discriminant: Some(Discriminant {
value: 2,
ty: IntTy::Unsuffixed,
}),
},
Variant {
ident: "C".into(),
attrs: vec![],
data: VariantData::Unit,
discriminant: None,
},
]),
}
from syn.
Related Issues (20)
- Constructing PatType HOT 1
- Span bytes are not reset on subsequent calls to parse_file. HOT 4
- `StrStyle` does not implement common traits HOT 3
- Remove `StrStyle` from public API
- Unused `lookahead1` call at `ExprIf` else parsing HOT 1
- ImplGenerics ToTokens ignores defaults of const Generics HOT 2
- Parse function delegation syntax
- Parsing "let mut" and quote! directly without modification HOT 1
- impl quote HOT 2
- DeriveInput fails to parse if an outer attribute is present. HOT 2
- Is there any way to get the Type what Type::Path points to? HOT 1
- failed to resolve: use of undeclared type `Lit` HOT 2
- Wrong visibility in impl_parse_for_custom_keyword macro ? HOT 2
- Expose `AllowNoSemi`, add `Stmt::requires_terminator` and allow custom function to be passed to `Block::parse_within`
- `TokenMarker` is unexported HOT 2
- implement `syn::parse::Parse` trait for (T1, ..., T7) HOT 1
- Generics in ItemConst HOT 1
- Make fields public for `syn::Visibility` HOT 1
- implement `Copy` for `Nothing` HOT 2
- add `Fold`/`VisitMut` methods for `Vec<T>`, `Option<T>`, `Punctuated`, etc.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from syn.