#[macro_export(json_macros)]
macro_rules! val {
([]) => (Val::Array(arr![]));
({}) => (Val::Obj(obj!{}));
([$($tt:tt)*]) => (Val::Array(arr![$($tt)*]));
(null) => (Val::Null);
(undefined) => (Val::Undef);
({$($tt:tt)*}) => (Val::Obj(obj!{$($tt)*}));
($val:expr) => ( Val::from($val));
(@next ({$($val:tt)*}) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* ({$($val)*}));
);
(@next ([$($val:tt)*]) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* ([$($val)*]));
);
(@next ([$($val:tt)*], $($rest:tt)+) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* ([$($val)*]) ($($rest)+));
);
(@next ({$($val:tt)*}, $($rest:tt)+) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* ({$($val)*}) ($($rest)+));
);
(@next (null, $($rest:tt)+) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* (null) ($($rest)+));
);
(@next (undefined, $($rest:tt)+) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* (undefined) ($($rest)+));
);
(@next ($val:expr, $($rest:tt)+) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* ($val) ($($rest)+));
);
(@next ({$($val:tt)*}) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* ({$($val)*}));
);
(@next (null) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* (null));
);
(@next (undefined) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* (undefined));
);
(@next ($val:expr) ($($next:tt)+) ($($args:tt)+)) => (
$($next)*($($args)* ($val));
);
}