Macros to make writing proc-macro crates easy

Overview

proc-easy

crates docs actions MIT/Apache loc

Macros to make writing proc-macro crates easy.

This crate provides mainly macros and supporting types and traits to reduce amount of boilerplate required for working with syn.

Currently most of the macros are targeted to construct types that then can be parses to configure proc-macro and proc-derive-macro implementation.

easy_token! - defines new custom token from ident. To be used in other structs.

easy_parse! - defines struct or enum that can be parsed and peeked from stream.

easy_argument! - defines struct with a token as a name and the rest to be parsed as-is.

easy_argument_group! - defines a group of arguments as enum of arguments.

easy_argument_tuple! - specialized version of easy_argument! that parses fields starting from 2nd as EasyArgumentFields inside parenthesis and in any order.

easy_argument_value! - specialized version of easy_argument! for 2 field structs. It defines 2nd field as a value that can be parsed after = token or inside parenthesis.

easy_separated! - defines struct that parses fields as EasyArgumentFields in any order. Does not accept trailing punctuation.

easy_terminated! - defines struct that parses fields as EasyArgumentFields in any order. Accepts trailing punctuation. Parses whole stream.

easy_attributes! - defines struct that parses fields as EasyArgumentFields from a slice of Attributes with specified namespace.

EasyArgumentField is implemented for types defined with easy_token!, easy_argument!, easy_argument_tuple!, easy_argument_value! and easy_argument_group! possibly wrapped in Option or Vec.

License

Licensed under either of

at your option.

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You might also like...
Procedural macros for Floccus

floccus-proc Procedural macros for floccus This crate contains procedural attribute macros (currently only one) used by the floccus. But potentially c

Macros for candle-lora.

candle-lora-macro This library makes using candle-lora as simple as adding 2 macros to your model structs and calling a method! It is inspired by the

Ever got frustrated when you realize that the for loop you were writing

for_each_repeat Ever got frustrated when you realize that the for loop you were writing... fn foo(mut iter: impl IteratorItem=i32) { for i in it

Rust SDK for writing contracts for Stellar Jump Cannon

rs-stellar-contract-sdk Rust SDK for writing contracts for Stellar Jump Cannon. This repository contains code that is in early development, incomplete

Tool to make Solus packaging even easier.

A small tool to make packaging for Solus even easier. Features Remove all packages from the local solbuild repo.

CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" format.

Lighthouse Groupie CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" form

little brother of gnu-copypasta-maker To compile, use make.

UWU Maker little brother of gnu-copypasta-maker To compile, use make. To install, use sudo make install or if you are root make install To uninstall,

A simply better way to make Discord bots.

Cognite 🚀 A simple blazingly fast language agnostic microservice driven Discord bot framework made in rust that leverages Apache Kafka and KeyDB to t

Wayland clipboard manager that will make you clap 👏

Clapboard - clipboard manager that makes you clap 👏 Clapboard is a simple clipboard manager for Wayland, built in Rust. It saves a history of your cl

Owner
Zakarum
Zakarum
Provide expansion of proc-macros, in a way that rustc directs you directly to the issues at hand

expander Expands a proc-macro into a file, and uses a include! directive in place. Advantages Only expands a particular proc-macro, not all of them. I

Bernhard Schuster 16 Oct 5, 2022
Example of structuring a proc macro crate for testability

testing-proc-macros Example of structuring a proc macro crate for testability. See accompanying blog post for details. License Licensed under either o

Ferrous Systems 12 Dec 11, 2022
A Rust proc-macro crate which derives functions to compile and parse back enums and structs to and from a bytecode representation

Bytecode A simple way to derive bytecode for you Enums and Structs. What is this This is a crate that provides a proc macro which will derive bytecode

null 4 Sep 3, 2022
Crates Registry is a tool for serving and publishing crates and serving rustup installation in offline networks.

Crates Registry Description Crates Registry is a tool for serving and publishing crates and serving rustup installation in offline networks. (like Ver

TalYRoni 5 Jul 6, 2023
A metamacro toolkit for writing complex macros.

Big Mac This crate contains the branching_parser! metamacro, which can be used to create complex macros with few lines of code. To use the macro, call

null 1 Nov 14, 2021
secmem-proc is a crate designed to harden a process against low-privileged attackers running on the same system trying to obtain secret memory contents of the current process.

secmem-proc is a crate designed to harden a process against low-privileged attackers running on the same system trying to obtain secret memory contents of the current process. More specifically, the crate disables core dumps and tries to disable tracing on unix-like OSes.

null 3 Dec 19, 2022
A copypastable guide to implementing simple derive macros in Rust.

A copypastable guide to implementing simple derive macros in Rust. The goal Let's say we have a trait with a getter trait MyTrait {

Imbolc 131 Dec 27, 2022
todo-or-die provides procedural macros that act as checked reminders.

todo-or-die provides procedural macros that act as checked reminders.

David Pedersen 552 Dec 24, 2022
Jonathan Kelley 33 Dec 6, 2022
twilight-interactions is a set of macros and utilities to work with Discord Interactions using twilight.

Twilight interactions twilight-interactions is a set of macros and utilities to work with Discord Interactions using twilight. Note: This crate is not

null 24 Dec 26, 2022