#programming-language #macro #built-in #function #rust-native #tokay

macro tokay-macros

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

3 releases (breaking)

0.4.0 Mar 5, 2023
0.3.0 Jan 13, 2023
0.1.0 May 17, 2022

#6 in #rust-native

Download history 18/week @ 2023-12-04 10/week @ 2023-12-18 7/week @ 2023-12-25 3/week @ 2024-01-01 1/week @ 2024-01-29 12/week @ 2024-02-12 2/week @ 2024-02-19 41/week @ 2024-02-26 4/week @ 2024-03-04 5/week @ 2024-03-11 13/week @ 2024-03-18

63 downloads per month
Used in tokay

MIT license

1MB
18K SLoC

tokay-macros

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


lib.rs:

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.

Dependencies

~5.5MB
~109K SLoC