[−][src]Macro glsp_engine::tab
Constructs a table.
The input syntax is any number of (key, value)
pairs, each surrounded by parentheses. They
can optionally be followed with a single "base" argument, prefixed with ..
, which must evaluate
to a &Tab
or a Root<Tab>
.
The return type is Root<Tab>
.
let original = tab! { (glsp::sym("a")?, 0), (glsp::sym("b")?, 1) }; let table = tab! { (glsp::sym("b")?, 1), (glsp::sym("c")?, 2), ..original }; println!("{}", table.len()); //prints 3
In the unlikely event that a key or value fails to be converted to a Val
, the
macro will panic. try_tab!
is the non-panicking alternative.