Skip to main content

table

Macro table 

Source
macro_rules! table {
    ($state:expr) => { ... };
    ($state:expr, [$($val:expr),* $(,)?]) => { ... };
    ($state:expr, { $($key:expr => $val:expr),* $(,)? }) => { ... };
}
Expand description

Macro to create Lua tables.

Examples:

// Empty table
let t1 = table!(state);
// Array-style
let t2 = table!(state, [1, 2, 3]);
// Map-style
let t3 = table!(state, { "key" => "value", "foo" => "bar" });