Merge branch 'feature/char-type' of github.com:AleoHQ/leo into feature/char-type

This commit is contained in:
gluax 2021-05-25 16:37:55 -04:00
commit bdcd945716
16 changed files with 145 additions and 17 deletions

View File

@ -0,0 +1,6 @@
[main]
y: bool = true;
a: char = '👍';
[registers]
r0: bool = true;

View File

@ -0,0 +1,6 @@
[main]
y: bool = true;
a: [char; 5] = "😭😂👍😁😘";
[registers]
r0: bool = true;

View File

@ -0,0 +1,9 @@
/*
namespace: Compile
expectation: Pass
input_file: input/main_char.in
*/
function main(a: char, y: bool) -> bool {
return y == true && a == '👍';
}

View File

@ -5,9 +5,5 @@ input_file: input/main_field.in
*/
function main(a: field, b: field, y: bool) -> bool {
// Change to assert when == is implemented for field.
console.log("a: {}", a);
console.log("b: {}", b);
return y == true;
return y == true && a == b;
}

View File

@ -0,0 +1,9 @@
/*
namespace: Compile
expectation: Pass
input_file: input/main_string.in
*/
function main(a: [char; 5], y: bool) -> bool {
return y == true && a == "😭😂👍😁😘";
}

View File

@ -0,0 +1,8 @@
[main]
y: bool = true;
[constants]
a: char = '👍';
[registers]
r0: bool = true;

View File

@ -0,0 +1,8 @@
[main]
y: bool = true;
[constants]
a: [char; 5] = "😭😂👍😁😘";
[registers]
r0: bool = true;

View File

@ -0,0 +1,9 @@
/*
namespace: Compile
expectation: Pass
input_file: input/main_char.in
*/
function main(const a: char, y: bool) -> bool {
return y == true && a == '👍';
}

View File

@ -5,9 +5,5 @@ input_file: input/main_field.in
*/
function main(const a: field, const b: field, y: bool) -> bool {
// Change to assert when == is implemented for field.
console.log("a: {}", a);
console.log("b: {}", b);
return y == true;
return y == true && a == b;
}

View File

@ -0,0 +1,9 @@
/*
namespace: Compile
expectation: Pass
input_file: input/main_string.in
*/
function main(const a: [char; 5], y: bool) -> bool {
return y == true && a == "😭😂👍😁😘";
}

View File

@ -0,0 +1,18 @@
---
namespace: Compile
expectation: Pass
outputs:
- circuit:
num_public_variables: 0
num_private_variables: 6
num_constraints: 5
at: a92e6894c8f239ebb17b299d1e49ef48d0c2a8690c56eb1362550ebeeb16a507
bt: 8f725e0070f28462aac3db98a5282a9ffa8139f0103651a30df68d193419eacd
ct: 6d17d0577f11cb480fd832f84c38611e836e8aa93457407aa17c07c6ef9d3e03
output:
- input_file: input/main_char.in
output:
registers:
r0:
type: bool
value: "true"

View File

@ -4,15 +4,15 @@ expectation: Pass
outputs:
- circuit:
num_public_variables: 0
num_private_variables: 3
num_constraints: 1
at: 9e8541580cdcbb8f5941f983c90dba7736b3911a1a3a55d1394880f187b832c8
bt: e18039133804a4c53e61e3a975b41a0423337da0df1fad627f00027f3be47b1d
ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05
num_private_variables: 6
num_constraints: 5
at: ab475a59a3c7d4299665005e00fe7232cd3ea2238493f31211c33f3057e3c1d7
bt: 691f0be87cb1ac6a001269af3d7dbe2c860290538950dc921f318ccf2f319d66
ct: 6d17d0577f11cb480fd832f84c38611e836e8aa93457407aa17c07c6ef9d3e03
output:
- input_file: input/main_field.in
output:
registers:
r0:
type: bool
value: "true"
value: "false"

View File

@ -0,0 +1,18 @@
---
namespace: Compile
expectation: Pass
outputs:
- circuit:
num_public_variables: 0
num_private_variables: 26
num_constraints: 21
at: b4c72e270b0067ca380a70c8cb2632c33b17e7323b3817deb04e5fe72aa99c13
bt: d476126ef8e9588f0ed444a75f025c1c468618ae84829d4d2deb37679e537563
ct: 789b2eca89cbf96799b7c12eaa66df8efcec7fe1c6c8af5e741fe4955c5dee32
output:
- input_file: input/main_string.in
output:
registers:
r0:
type: bool
value: "true"

View File

@ -0,0 +1,18 @@
---
namespace: Compile
expectation: Pass
outputs:
- circuit:
num_public_variables: 0
num_private_variables: 1
num_constraints: 1
at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f
bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c
ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05
output:
- input_file: input/main_char.in
output:
registers:
r0:
type: bool
value: "true"

View File

@ -15,4 +15,4 @@ outputs:
registers:
r0:
type: bool
value: "true"
value: "false"

View File

@ -0,0 +1,18 @@
---
namespace: Compile
expectation: Pass
outputs:
- circuit:
num_public_variables: 0
num_private_variables: 1
num_constraints: 1
at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f
bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c
ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05
output:
- input_file: input/main_string.in
output:
registers:
r0:
type: bool
value: "true"