(so I maybe finish some of it)
- Sane Figglet unicode and toml based fogfont format
- macro_rules like proc macro input parser
- Implement secret store for ENV tokens
- Email client
- bitfireAT/icsx5#235
License: Apache License 2.0
(so I maybe finish some of it)
Add
PseudoExpr
Should collect a superset of valid expression syntax in a tokenstream.PseudoType
Should collect a superset of valid type syntax in a tokenstreamAdd
PseudoExpr
Should collect a superset of valid expression syntax in a tokenstream.PseudoType
Should collect a superset of valid type syntax in a tokenstreamSo that users don't have to do this.
Similar to #4, I'm adding a new attribute for ViewSchema and want to share the view()
identifier name, so that all the parameters just live on the same level, but I can avoid repeating the shared attributes on both types. Using the same example from #4, what I would hope is for:
struct Attr {
#[attribute(flatten)]
shared: SharedAttributes
}
struct SharedAttributes {
shared_key: String
}
Should parse
#[attr(shared_key = "hi")]
Sometimes complex attributes might require sub attributes like so:
struct Attr {
#[attribute(sub_attribute)]
key: SubAttr
}
struct SubAttr {
sub_key: String
}
Should parse
#[attr(key(sub_key = "hi"))]
When upgrading refuse-macros
from 0.8 to 0.9, my usage of syn::ExprClosure
no longer compiles with this error:
error[E0277]: the trait bound `syn::ExprClosure: attribute_derive::parsing::AttributeBase` is not satisfied
--> refuse-macros/src/lib.rs:202:10
|
202 | #[derive(FromAttr)]
| ^^^^^^^^ the trait `attribute_derive::parsing::AttributeBase` is not implemented for `syn::ExprClosure`
|
= help: the following other types implement trait `attribute_derive::parsing::AttributeBase`:
bool
char
isize
i8
i16
i32
i64
i128
and 173 others
= note: required for `std::option::Option<syn::ExprClosure>` to implement `attribute_derive::parsing::AttributeBase`
= note: this error originates in the derive macro `FromAttr` (in Nightly builds, run with -Z macro-backtrace for more info)
I'm not sure if this isn't meant to be supported, if there's a better syn type to be using, or if this is just an oversight.
Edit: Oops, didn't realize that I haven't pushed the macro changes yet. Here's what the usage looks like:
#[derive(FromAttr)]
#[attribute(ident = collectable)]
struct MapAsAttr {
target: Option<syn::Type>,
map: Option<syn::ExprClosure>,
}
I took an example directly from the docs:
#[derive(Attribute)]
#[attribute(ident = "collection")]
#[attribute(invalid_field = "Error when an unsupported value is set (e.g. meaning=42")]
struct CollectionAttribute {
// Options are optional by default (will be set to None if not specified)
authority: Option<String>,
#[attribute(missing = "Error when the value is not set")]
name: String,
// Any type implementing default can be flagged as default
// This will be set to Vec::default() when not specified
#[attribute(default)]
#[attribute(expected = "Error when an error occured while parsing")]
views: Vec<Type>,
}
But I'm getting an error
error: expected `#[attribute(ident=attribute_name, aliases=[alias1, alias2], error="..", error(unknown_field="..", unknown_field_single="..", unknown_field_empty="..", duplicate_field="..", missing_field="..", field_help="..", missing_flag"..", flag_help".."))]`
--> node_macro/src/lib.rs:6:10
|
6 | #[derive(Attribute)]
| ^^^^^^^^^
|
= note: this error originates in the derive macro `Attribute` (in Nightly builds, run with -Z macro-backtrace for more info)
My Cargo.toml:
[package]
name = "node_macro"
version = "0.1.0"
edition = "2021"
[lib]
proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
syn = { version = "2.0" }
quote = "1.0"
proc-macro2 = "1.0"
attribute-derive = "0.6"
i.e.:
#[derive(FromAttr)]
#[attribute(flatten)]
struct FieldAttribute {
default: FlagOrValue<Expr>,
children: bool,
}
would parse
#[default]
#[default = <expr>]
// This is supported additionally, because
// `=` only supports a subset of expressions
#[default(<expr>)]
#[children]
We could support this maybe as a fieldlevel attribute as well, or allow the field value to be anything that implements FromAttr
to allow hybrid structs with nested and unnested attributes.
Support the "standard" way of using "meta" attributes:
#[derive(Attribute)]
struct Args {
#[attribute(quoted)]
key: Expression,
#[attribute(parenthesized)]
other: Path
}
should parse something like
#[attr(key="a + b", other(::a::b::C))]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.