#programming-language #rust-native #macro #building #tokay

macro tokay-macros

Macro support for Rust-native builtin functions for the Tokay programming language

4 releases (breaking)

0.5.0 Jun 19, 2024
0.4.0 Mar 5, 2023
0.3.0 Jan 13, 2023
0.1.0 May 17, 2022

#35 in #rust-native

Download history 5/week @ 2025-03-09 26/week @ 2025-03-16 1/week @ 2025-03-23 6/week @ 2025-04-13 18/week @ 2025-04-20 377/week @ 2025-04-27 245/week @ 2025-05-04 44/week @ 2025-05-11 186/week @ 2025-05-18 63/week @ 2025-05-25 1/week @ 2025-06-01 220/week @ 2025-06-08 475/week @ 2025-06-15 340/week @ 2025-06-22

1,036 downloads per month
Used in tokay

MIT license

1.5MB
19K SLoC

Tokay proc-macros

This crate contains the proc-macro implementation for

  • tokay_function!(signature, expression) - Built-in function
  • tokay_method!(signature, expression) - Built-in object method
  • tokay_token!(signature, expression) - Built-in consuming function

Every macro generates a slightly different version of a callable built-in.

All macros require for two parameters:

  • signature is a Tokay-style function signature string, including default values. This can be f, f(), f(a, b), f(a b = void) or similar. Currently, this does only accept for a subset of Tokay atomics: void, null, true, false, and integer values.
  • expression is the Rust expression to be executed. This is the body of the function.

tokay-macros

tokay-macros provide utilities currently used for building the Tokay programming language.

Dependencies

~7MB
~136K SLoC