diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-02 18:09:13 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-02 19:50:06 +0100 |
| commit | 10675cd6d510521715c5e33508d80c4193ad9d74 (patch) | |
| tree | 676435532b2c224b4b9feafd6e1a07cd30a0e923 /macros/src/lib.rs | |
| parent | e9ff2d6463bf26cb0bbafb747bf8a77800687e3f (diff) | |
Merge text and math symbols
Diffstat (limited to 'macros/src/lib.rs')
| -rw-r--r-- | macros/src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 064e45b2..e162745a 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -22,6 +22,7 @@ mod capable; mod castable; mod func; mod node; +mod symbols; use proc_macro::TokenStream as BoundaryStream; use proc_macro2::{TokenStream, TokenTree}; @@ -68,6 +69,14 @@ pub fn castable(stream: BoundaryStream) -> BoundaryStream { .into() } +/// Define a list of symbols. +#[proc_macro] +pub fn symbols(stream: BoundaryStream) -> BoundaryStream { + symbols::symbols(stream.into()) + .unwrap_or_else(|err| err.to_compile_error()) + .into() +} + /// Extract documentation comments from an attribute list. fn documentation(attrs: &[syn::Attribute]) -> String { let mut doc = String::new(); |
