mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-26 19:51:52 +03:00
Introduce Type::Signature to the AST
This commit is contained in:
parent
e180118a30
commit
46e9313e55
@ -40,6 +40,8 @@ pub enum Type {
|
||||
Mapping(MappingType),
|
||||
/// The `scalar` type.
|
||||
Scalar,
|
||||
/// The `signature` type.
|
||||
Signature,
|
||||
/// The `string` type.
|
||||
String,
|
||||
/// A static tuple of at least one type.
|
||||
@ -64,6 +66,7 @@ impl Type {
|
||||
| (Type::Field, Type::Field)
|
||||
| (Type::Group, Type::Group)
|
||||
| (Type::Scalar, Type::Scalar)
|
||||
| (Type::Signature, Type::Signature)
|
||||
| (Type::String, Type::String)
|
||||
| (Type::Unit, Type::Unit) => true,
|
||||
(Type::Integer(left), Type::Integer(right)) => left.eq(right),
|
||||
@ -90,6 +93,7 @@ impl fmt::Display for Type {
|
||||
Type::Integer(ref integer_type) => write!(f, "{integer_type}"),
|
||||
Type::Mapping(ref mapping_type) => write!(f, "{mapping_type}"),
|
||||
Type::Scalar => write!(f, "scalar"),
|
||||
Type::Signature => write!(f, "signature"),
|
||||
Type::String => write!(f, "string"),
|
||||
Type::Tuple(ref tuple) => write!(f, "{tuple}"),
|
||||
Type::Unit => write!(f, "()"),
|
||||
|
@ -26,6 +26,7 @@ impl<'a> CodeGenerator<'a> {
|
||||
| Type::Field
|
||||
| Type::Group
|
||||
| Type::Scalar
|
||||
| Type::Signature
|
||||
| Type::String
|
||||
| Type::Integer(..) => format!("{input}"),
|
||||
Type::Identifier(ident) => format!("{ident}"),
|
||||
|
@ -208,6 +208,7 @@ symbols! {
|
||||
i128,
|
||||
record,
|
||||
scalar,
|
||||
signature,
|
||||
string,
|
||||
Struct: "struct",
|
||||
u8,
|
||||
|
Loading…
Reference in New Issue
Block a user