add type signatures for new builtins.
This commit is contained in:
parent
96b864f655
commit
1f1e68712c
|
@ -908,19 +908,83 @@ pub fn from_default_function(builtin: DefaultFunction, id_gen: &IdGenerator) ->
|
||||||
|
|
||||||
(tipo, 2)
|
(tipo, 2)
|
||||||
}
|
}
|
||||||
DefaultFunction::AndByteString => todo!(),
|
DefaultFunction::AndByteString => {
|
||||||
DefaultFunction::OrByteString => todo!(),
|
let tipo = Type::function(
|
||||||
DefaultFunction::XorByteString => todo!(),
|
vec![Type::byte_array(), Type::byte_array()],
|
||||||
DefaultFunction::ComplementByteString => todo!(),
|
Type::byte_array(),
|
||||||
DefaultFunction::ReadBit => todo!(),
|
);
|
||||||
DefaultFunction::WriteBits => todo!(),
|
|
||||||
DefaultFunction::ReplicateByte => todo!(),
|
(tipo, 2)
|
||||||
DefaultFunction::ShiftByteString => todo!(),
|
}
|
||||||
DefaultFunction::RotateByteString => todo!(),
|
DefaultFunction::OrByteString => {
|
||||||
DefaultFunction::CountSetBits => todo!(),
|
let tipo = Type::function(
|
||||||
DefaultFunction::FindFirstSetBit => todo!(),
|
vec![Type::byte_array(), Type::byte_array()],
|
||||||
DefaultFunction::Ripemd_160 => todo!(),
|
Type::byte_array(),
|
||||||
DefaultFunction::ExpModInteger => todo!(),
|
);
|
||||||
|
|
||||||
|
(tipo, 2)
|
||||||
|
}
|
||||||
|
DefaultFunction::XorByteString => {
|
||||||
|
let tipo = Type::function(
|
||||||
|
vec![Type::byte_array(), Type::byte_array()],
|
||||||
|
Type::byte_array(),
|
||||||
|
);
|
||||||
|
|
||||||
|
(tipo, 2)
|
||||||
|
}
|
||||||
|
DefaultFunction::ComplementByteString => {
|
||||||
|
let tipo = Type::function(vec![Type::byte_array()], Type::byte_array());
|
||||||
|
|
||||||
|
(tipo, 1)
|
||||||
|
}
|
||||||
|
DefaultFunction::ReadBit => {
|
||||||
|
let tipo = Type::function(vec![Type::byte_array(), Type::int()], Type::bool());
|
||||||
|
|
||||||
|
(tipo, 2)
|
||||||
|
}
|
||||||
|
DefaultFunction::WriteBits => {
|
||||||
|
let tipo = Type::function(
|
||||||
|
vec![Type::byte_array(), Type::list(Type::int()), Type::bool()],
|
||||||
|
Type::byte_array(),
|
||||||
|
);
|
||||||
|
|
||||||
|
(tipo, 3)
|
||||||
|
}
|
||||||
|
DefaultFunction::ReplicateByte => {
|
||||||
|
let tipo = Type::function(vec![Type::int(), Type::int()], Type::byte_array());
|
||||||
|
|
||||||
|
(tipo, 2)
|
||||||
|
}
|
||||||
|
DefaultFunction::ShiftByteString => {
|
||||||
|
let tipo = Type::function(vec![Type::byte_array(), Type::int()], Type::byte_array());
|
||||||
|
|
||||||
|
(tipo, 2)
|
||||||
|
}
|
||||||
|
DefaultFunction::RotateByteString => {
|
||||||
|
let tipo = Type::function(vec![Type::byte_array(), Type::int()], Type::byte_array());
|
||||||
|
|
||||||
|
(tipo, 2)
|
||||||
|
}
|
||||||
|
DefaultFunction::CountSetBits => {
|
||||||
|
let tipo = Type::function(vec![Type::byte_array()], Type::int());
|
||||||
|
|
||||||
|
(tipo, 1)
|
||||||
|
}
|
||||||
|
DefaultFunction::FindFirstSetBit => {
|
||||||
|
let tipo = Type::function(vec![Type::byte_array()], Type::int());
|
||||||
|
|
||||||
|
(tipo, 1)
|
||||||
|
}
|
||||||
|
DefaultFunction::Ripemd_160 => {
|
||||||
|
let tipo = Type::function(vec![Type::byte_array()], Type::byte_array());
|
||||||
|
|
||||||
|
(tipo, 1)
|
||||||
|
}
|
||||||
|
DefaultFunction::ExpModInteger => {
|
||||||
|
let tipo = Type::function(vec![Type::int(), Type::int(), Type::int()], Type::int());
|
||||||
|
|
||||||
|
(tipo, 3)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ValueConstructor::public(
|
ValueConstructor::public(
|
||||||
|
|
Loading…
Reference in New Issue