mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 07:07:07 +03:00
Merge branch 'master' of github.com:AleoHQ/leo into feature/console-refactor-and-outs
This commit is contained in:
commit
9a53905a55
70
Cargo.lock
generated
70
Cargo.lock
generated
@ -167,9 +167,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||
|
||||
[[package]]
|
||||
name = "bitvec"
|
||||
version = "0.22.3"
|
||||
version = "0.19.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5237f00a8c86130a0cc317830e558b966dd7850d48a953d998c813f01a41b527"
|
||||
checksum = "8942c8d352ae1838c9dda0b0ca2ab657696ef2232a20147cf1b30ae1a9cb4321"
|
||||
dependencies = [
|
||||
"funty",
|
||||
"radium",
|
||||
@ -402,9 +402,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "criterion"
|
||||
version = "0.3.4"
|
||||
version = "0.3.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ab327ed7354547cc2ef43cbe20ef68b988e70b4b593cbd66a2a61733123a3d23"
|
||||
checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"cast",
|
||||
@ -428,12 +428,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "criterion-plot"
|
||||
version = "0.4.3"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e022feadec601fba1649cfa83586381a4ad31c6bf3a9ab7d408118b05dd9889d"
|
||||
checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57"
|
||||
dependencies = [
|
||||
"cast",
|
||||
"itertools 0.9.0",
|
||||
"itertools 0.10.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -776,9 +776,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
|
||||
|
||||
[[package]]
|
||||
name = "funty"
|
||||
version = "1.2.0"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e"
|
||||
checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7"
|
||||
|
||||
[[package]]
|
||||
name = "futf"
|
||||
@ -1111,15 +1111,6 @@ dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.10.1"
|
||||
@ -1983,9 +1974,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "radium"
|
||||
version = "0.6.2"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb"
|
||||
checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8"
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
@ -2446,9 +2437,9 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
|
||||
|
||||
[[package]]
|
||||
name = "snarkvm-algorithms"
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "352a3345d4ba258c1454b459f6449b48ae2062c686e8beba43805031abb70c72"
|
||||
checksum = "dd8bbefe6252ed85bb073f8ecbc402830e3d119b1aaadcea5a9c9e7a21a99cd2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bitvec",
|
||||
@ -2503,9 +2494,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "snarkvm-dpc"
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4e778b5e032a4c48e2a12a1806ca10044900d92c0ae42e721faa85af40430109"
|
||||
checksum = "af8dd1b815a1101c4014c17cbdffadecb1032e8662fdf5fd4bd67a3c149d8449"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base58",
|
||||
@ -2551,9 +2542,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "snarkvm-gadgets"
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "552bb91384d004a314d27eefd863c0992a3a984b7e5dcfce711b4e85f1cbfc03"
|
||||
checksum = "7b462bb5e5ac219eafd1a828c73c181e7b23692ade5c49fd72d71bfe4250a6b1"
|
||||
dependencies = [
|
||||
"derivative",
|
||||
"digest 0.9.0",
|
||||
@ -2571,9 +2562,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "snarkvm-marlin"
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2af3e3720556f0fd653e2255c0e2aa1333624e658b759eb109f6364f9456c7f"
|
||||
checksum = "2e5b1bb7923a757053c0a544072ec6b298585f83c9f4a3ae777ca048bb6e5589"
|
||||
dependencies = [
|
||||
"blake2",
|
||||
"derivative",
|
||||
@ -2595,9 +2586,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "snarkvm-parameters"
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bae615fbc1065cfe3e23dd8e3407148c4e7a5afa1632e3120f4b85ad099d810"
|
||||
checksum = "14356edda788a3e52ac6e809e6fdbfd5cf7558249bf6051525843b045a73d12a"
|
||||
dependencies = [
|
||||
"curl",
|
||||
"hex",
|
||||
@ -2608,9 +2599,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "snarkvm-polycommit"
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7f72af773beed90a4ef947ad153b7cc9733e543414d144b68d7d3d62b32fd98"
|
||||
checksum = "28fac50de72680316fe57fbbbde2874ae28de7191a3f23ff9e541119951ddaa8"
|
||||
dependencies = [
|
||||
"derivative",
|
||||
"digest 0.9.0",
|
||||
@ -2627,15 +2618,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "snarkvm-profiler"
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2a428f675f2df8c3aa3683ee583ea36fd8ecff5959cdcd528c07f209986d3614"
|
||||
checksum = "2ebfa546f0376a1348b857a9defdb3f4505a0420d82f8caa2b0cebbe197245fa"
|
||||
|
||||
[[package]]
|
||||
name = "snarkvm-r1cs"
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42fc7eaab616b21fb6e0dab4f0c9402a8c831d7c65fa5e4eb941919bf7d9ea33"
|
||||
checksum = "2aca9bb7105244ebc91f964b11a1ae63f173a77181307d1fa94f04e15dbde137"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"fxhash",
|
||||
@ -3306,12 +3297,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wyz"
|
||||
version = "0.4.0"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "129e027ad65ce1453680623c3fb5163cbf7107bfe1aa32257e7d0e63f9ced188"
|
||||
dependencies = [
|
||||
"tap",
|
||||
]
|
||||
checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214"
|
||||
|
||||
[[package]]
|
||||
name = "yaml-rust"
|
||||
|
@ -81,11 +81,11 @@ version = "0.7.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.snarkvm-gadgets]
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.snarkvm-r1cs]
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.snarkvm-utilities]
|
||||
|
@ -65,16 +65,16 @@ version = "0.7.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.snarkvm-dpc]
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.snarkvm-gadgets]
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
default-features = false
|
||||
features = ["curves"]
|
||||
|
||||
[dependencies.snarkvm-r1cs]
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.snarkvm-utilities]
|
||||
|
@ -57,7 +57,8 @@ impl<'a, F: PrimeField, G: GroupType<F>> ConstrainedProgram<'a, F, G> {
|
||||
(true, true) => Box::new(from..=to),
|
||||
(true, false) => Box::new(from..to),
|
||||
(false, true) => Box::new((to..=from).rev()),
|
||||
(false, false) => Box::new((to..from).rev()),
|
||||
// add the range to the values to get correct bound
|
||||
(false, false) => Box::new(((to + 1)..(from + 1)).rev()),
|
||||
};
|
||||
|
||||
for i in iter {
|
||||
|
Binary file not shown.
@ -395,7 +395,6 @@ keyword = %s"address"
|
||||
/ %s"console"
|
||||
/ %s"const"
|
||||
/ %s"else"
|
||||
/ %s"false"
|
||||
/ %s"field"
|
||||
/ %s"for"
|
||||
/ %s"function"
|
||||
@ -416,7 +415,6 @@ keyword = %s"address"
|
||||
/ %s"self"
|
||||
/ %s"static"
|
||||
/ %s"string"
|
||||
/ %s"true"
|
||||
/ %s"u8"
|
||||
/ %s"u16"
|
||||
/ %s"u32"
|
||||
@ -448,7 +446,8 @@ hexadecimal-digit = digit / "a" / "b" / "c" / "d" / "e" / "f"
|
||||
; because that is used for address literals:
|
||||
; this is another extra-grammatical requirement.
|
||||
|
||||
identifier = letter *( letter / digit / "_" ) ; but not a keyword or aleo1...
|
||||
identifier = letter *( letter / digit / "_" )
|
||||
; but not a keyword or a boolean literal or aleo1...
|
||||
|
||||
; A package name consists of one or more segments separated by single dashes,
|
||||
; where each segment is a non-empty sequence of lowercase letters and digits.
|
||||
@ -457,7 +456,7 @@ identifier = letter *( letter / digit / "_" ) ; but not a keyword or aleo1...
|
||||
|
||||
package-name = lowercase-letter *( lowercase-letter / digit )
|
||||
*( "-" 1*( lowercase-letter / digit ) )
|
||||
; but not a keyword or aleo1...
|
||||
; but not a keyword or a boolean literal or aleo1...
|
||||
|
||||
; Note that, grammatically, identifiers are also package names.
|
||||
; They are disambiguated from context, based on the syntactic grammar.
|
||||
|
@ -33,7 +33,7 @@ version = "0.7.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.snarkvm-dpc]
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
features = [ "testnet1" ]
|
||||
|
||||
[dependencies.snarkvm-utilities]
|
||||
|
@ -26,10 +26,10 @@ version = "0.7.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.snarkvm-gadgets]
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
|
||||
[dependencies.snarkvm-r1cs]
|
||||
version = "0.7.4"
|
||||
version = "0.7.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.num-bigint]
|
||||
|
@ -6,7 +6,7 @@ input_file: inputs/dummy.in
|
||||
|
||||
function main(k: bool) -> bool {
|
||||
let reverse: u32 = 0;
|
||||
for i in 10..0 {
|
||||
for i in 9..0 {
|
||||
reverse += i;
|
||||
}
|
||||
|
||||
|
19
tests/compiler/statements/reverse_loops.leo
Normal file
19
tests/compiler/statements/reverse_loops.leo
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: inputs/dummy.in
|
||||
*/
|
||||
|
||||
function main(k: bool) -> bool {
|
||||
let reverse: u32 = 0;
|
||||
for i in 25..1 {
|
||||
reverse += i;
|
||||
}
|
||||
|
||||
let reverse_inclusive: u32 = 0;
|
||||
for a in 25..=1 {
|
||||
reverse_inclusive += a;
|
||||
}
|
||||
|
||||
return (reverse + 1 == reverse_inclusive) && k;
|
||||
}
|
19
tests/compiler/statements/reverse_one.leo
Normal file
19
tests/compiler/statements/reverse_one.leo
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: inputs/dummy.in
|
||||
*/
|
||||
|
||||
function main(k: bool) -> bool {
|
||||
let reverse: u32 = 0;
|
||||
for i in 1..0 {
|
||||
reverse += i;
|
||||
}
|
||||
|
||||
let reverse_inclusive: u32 = 0;
|
||||
for a in 1..=0 {
|
||||
reverse_inclusive += a;
|
||||
}
|
||||
|
||||
return (reverse == 1) && (reverse_inclusive == 1) && k;
|
||||
}
|
@ -16,6 +16,6 @@ outputs:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 7ecd56e44c6b1cb4f702a2712a2a7fe3bf564dac26a70e1f14151a688fb24769
|
||||
canonicalized_ast: 360ecac21f95b0e1d949d49458f2c4557446d01db08333d6f25621ef47a78a66
|
||||
type_inferenced_ast: 853fdefe080011aaa35363e827a527ab7ce6c7e93cd568c8a150211fa6e402fe
|
||||
initial_ast: 280277fb32e4eece0eab1f72338a9b60b6792d7f11124e8c4a5678ef3fc4a04e
|
||||
canonicalized_ast: 84769d3580d79825fef6fd00dd9ab88dc6eaf16bf2e3f3c46feae654f8f1f746
|
||||
type_inferenced_ast: 078070bc5df73c49f8de0ca37ac624c93a67551e0221dc1c65a84588507a2a6f
|
||||
|
@ -0,0 +1,21 @@
|
||||
---
|
||||
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: inputs/dummy.in
|
||||
output:
|
||||
registers:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 41a0c534538a94dc81b72250c2fc9f4119c6b8d3f3e99e47e239365284bd0084
|
||||
canonicalized_ast: 6c3f732c92874e90be8cab55ac665c6f6d4292d76fce147ae89ed9dbdfe685ea
|
||||
type_inferenced_ast: 2258791abdb7bde2e3f28a12ff8b5d593985c42d78e3750d6b5f44d88d0560ed
|
@ -0,0 +1,21 @@
|
||||
---
|
||||
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: inputs/dummy.in
|
||||
output:
|
||||
registers:
|
||||
r0:
|
||||
type: bool
|
||||
value: "true"
|
||||
initial_ast: 55d64e1ef9318084a66cee912987308a21c5779cdad1f0103d6b3fb195f74d8a
|
||||
canonicalized_ast: 467824b3c4be8e0d10d6008a036f40bed2659a18ab7eb2ea2a5c7124146d9b06
|
||||
type_inferenced_ast: b0908f46546647877409194ca817072d02f157b720236c7f58b5d3b0b7cfb81f
|
Loading…
Reference in New Issue
Block a user