lang_util_derive/
lib.rs

1//! `lang-util-derive` is a proc-macro crate providing automatically derived implementations of the
2//! traits provided by [`lang-util`](https://crates.io/crates/lang-util).
3//!
4//! These macros are re-exported by the `lang-util` crate, which you should depend on instead.
5
6#![deny(missing_docs)]
7
8#[macro_use]
9extern crate darling;
10
11mod node_display;
12
13/// Derives an implementation of `NodeContentDisplay` for the given type.
14#[proc_macro_derive(NodeContentDisplay, attributes(lang_util))]
15pub fn node_display(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
16    node_display::node_display(input)
17}
18
19mod token;
20
21/// Derive `lang_util::error::Token` for an enum usable with Logos
22#[proc_macro_derive(Token, attributes(lang_util))]
23pub fn token(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
24    token::token(input)
25}