nanvm_demos/gen.samples/
operators.rs1use nanvm_lib::vm::unstable::{f64_any, string_any, string_key};
4use nanvm_lib::vm::{Any, Array, IStaticFunction, ToAny, ToArray, ToObject};
5
6#[rustfmt::skip]
7#[allow(clippy::if_same_then_else)]
8pub fn module<A: IStaticFunction>(_runtime: Any<A>) -> Result<Any<A>, Any<A>> {
9 Ok([(string_key("default"), A::static_function(|_self, _args| {
10 let _b972: Any<A> = _args.rest(0).to_any();
11 Ok([((Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())? + (f64_any(0x4000000000000000) * f64_any(0x4008000000000000))?)?, (f64_any(0x401c000000000000) % (Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?)?, (Any::pow(f64_any(0x4000000000000000), (Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?))?, (Any::bitwise_not((Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?))?, (<Any<A> as core::ops::Not>::not((Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?))?, (Any::typeof_((Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?))?, if Any::<A>::to_boolean((Any::gt((Any::dot(_b972.clone(), f64_any(0x0000000000000000)).end())?, f64_any(0x3ff0000000000000)))?) { string_any("big") } else { string_any("small") }].to_array().to_any())
12 }, 0, Array::default(), Some("(...$0)=>[$0[0]+2*3,7%$0[0],2**$0[0],~$0[0],!$0[0],typeof $0[0],$0[0]>1?\"big\":\"small\"]")).to_any())].to_object().to_any())
13}