mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-22 22:44:47 +03:00
test expectations
This commit is contained in:
parent
292f890369
commit
14fc864e0c
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [ETYC0372052]: The number of transitions exceeds the maximum. snarkVM allows up to 31 transitions within a single program.\n --> compiler-test:3:9\n |\n 3 | program test.aleo {\n | ^^^^^^^^^\n"
|
||||
- "Error [ETYC0372052]: The number of transitions exceeds the maximum. snarkVM allows up to 31 transitions within a single program.\n --> compiler-test:1:1\n |\n 1 | \n 2 | \n 3 | program test.aleo {\n | ^^^^^^^^^^^^\n"
|
||||
|
@ -2,4 +2,4 @@
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [ETYC0372072]: The number of mappings exceeds the maximum. snarkVM allows up to 31 mappings within a single program.\n --> compiler-test:3:9\n |\n 3 | program test.aleo {\n | ^^^^^^^^^\n"
|
||||
- "Error [ETYC0372072]: The number of mappings exceeds the maximum. snarkVM allows up to 31 mappings within a single program.\n --> compiler-test:1:1\n |\n 1 | \n 2 | \n 3 | program test.aleo {\n | ^^^^^^^^^^^^\n"
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":126,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":130}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings:
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370034]: Empty functions cannot have finalize functions attached to them.\n --> test:5:14\n |\n 5 | finalize foo() {\n | ^^^"
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings:
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370028]: Invalid network identifier. The only supported identifier is `aleo`.\n --> test:3:14\n |\n 3 | program test.eth {\n | ^^^"
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs:
|
||||
- - token
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs:
|
||||
- - foo
|
||||
|
630
tests/expectations/parser/program/stub.out
Normal file
630
tests/expectations/parser/program/stub.out
Normal file
@ -0,0 +1,630 @@
|
||||
---
|
||||
namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs:
|
||||
credits:
|
||||
stub_id: "{\"name\":\"credits\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs:
|
||||
- - credits
|
||||
- identifier: "{\"id\":\"2\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":40}\"}"
|
||||
members:
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"3\",\"name\":\"owner\",\"span\":\"{\\\"lo\\\":51,\\\"hi\\\":56}\"}"
|
||||
type_: Address
|
||||
span:
|
||||
lo: 51
|
||||
hi: 65
|
||||
id: 4
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"5\",\"name\":\"micrcredits\",\"span\":\"{\\\"lo\\\":75,\\\"hi\\\":86}\"}"
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 75
|
||||
hi: 91
|
||||
id: 6
|
||||
is_record: true
|
||||
span:
|
||||
lo: 26
|
||||
hi: 98
|
||||
id: 7
|
||||
- - Row
|
||||
- identifier: "{\"id\":\"8\",\"name\":\"Row\",\"span\":\"{\\\"lo\\\":110,\\\"hi\\\":113}\"}"
|
||||
members:
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"9\",\"name\":\"c1\",\"span\":\"{\\\"lo\\\":124,\\\"hi\\\":126}\"}"
|
||||
type_:
|
||||
Integer: U8
|
||||
span:
|
||||
lo: 124
|
||||
hi: 130
|
||||
id: 10
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"11\",\"name\":\"c2\",\"span\":\"{\\\"lo\\\":140,\\\"hi\\\":142}\"}"
|
||||
type_:
|
||||
Integer: U8
|
||||
span:
|
||||
lo: 140
|
||||
hi: 146
|
||||
id: 12
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"13\",\"name\":\"c3\",\"span\":\"{\\\"lo\\\":156,\\\"hi\\\":158}\"}"
|
||||
type_:
|
||||
Integer: U8
|
||||
span:
|
||||
lo: 156
|
||||
hi: 162
|
||||
id: 14
|
||||
is_record: false
|
||||
span:
|
||||
lo: 103
|
||||
hi: 168
|
||||
id: 15
|
||||
- - board_state
|
||||
- identifier: "{\"id\":\"18\",\"name\":\"board_state\",\"span\":\"{\\\"lo\\\":216,\\\"hi\\\":227}\"}"
|
||||
members:
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"19\",\"name\":\"owner\",\"span\":\"{\\\"lo\\\":238,\\\"hi\\\":243}\"}"
|
||||
type_: Address
|
||||
span:
|
||||
lo: 238
|
||||
hi: 252
|
||||
id: 20
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"21\",\"name\":\"hits_and_misses\",\"span\":\"{\\\"lo\\\":329,\\\"hi\\\":344}\"}"
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 329
|
||||
hi: 349
|
||||
id: 22
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"23\",\"name\":\"played_tiles\",\"span\":\"{\\\"lo\\\":429,\\\"hi\\\":441}\"}"
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 429
|
||||
hi: 446
|
||||
id: 24
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"25\",\"name\":\"ships\",\"span\":\"{\\\"lo\\\":536,\\\"hi\\\":541}\"}"
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 536
|
||||
hi: 546
|
||||
id: 26
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"27\",\"name\":\"player_1\",\"span\":\"{\\\"lo\\\":556,\\\"hi\\\":564}\"}"
|
||||
type_: Address
|
||||
span:
|
||||
lo: 556
|
||||
hi: 573
|
||||
id: 28
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"29\",\"name\":\"player_2\",\"span\":\"{\\\"lo\\\":583,\\\"hi\\\":591}\"}"
|
||||
type_: Address
|
||||
span:
|
||||
lo: 583
|
||||
hi: 600
|
||||
id: 30
|
||||
- mode: None
|
||||
identifier: "{\"id\":\"31\",\"name\":\"game_started\",\"span\":\"{\\\"lo\\\":610,\\\"hi\\\":622}\"}"
|
||||
type_: Boolean
|
||||
span:
|
||||
lo: 610
|
||||
hi: 628
|
||||
id: 32
|
||||
is_record: true
|
||||
span:
|
||||
lo: 209
|
||||
hi: 635
|
||||
id: 33
|
||||
mappings:
|
||||
- - num_winners
|
||||
- identifier: "{\"id\":\"16\",\"name\":\"num_winners\",\"span\":\"{\\\"lo\\\":181,\\\"hi\\\":192}\"}"
|
||||
key_type:
|
||||
Integer: U8
|
||||
value_type:
|
||||
Integer: U8
|
||||
span:
|
||||
lo: 173
|
||||
hi: 203
|
||||
id: 17
|
||||
functions:
|
||||
- - mint
|
||||
- annotations: []
|
||||
variant: Transition
|
||||
identifier: "{\"id\":\"34\",\"name\":\"mint\",\"span\":\"{\\\"lo\\\":652,\\\"hi\\\":656}\"}"
|
||||
input:
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"35\",\"name\":\"a1\",\"span\":\"{\\\"lo\\\":664,\\\"hi\\\":666}\"}"
|
||||
mode: Public
|
||||
type_: Address
|
||||
span:
|
||||
lo: 664
|
||||
hi: 666
|
||||
id: 36
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"37\",\"name\":\"a2\",\"span\":\"{\\\"lo\\\":684,\\\"hi\\\":686}\"}"
|
||||
mode: Public
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 684
|
||||
hi: 686
|
||||
id: 38
|
||||
output:
|
||||
- Internal:
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"39\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":696,\\\"hi\\\":703}\"}"
|
||||
span:
|
||||
lo: 696
|
||||
hi: 703
|
||||
id: 40
|
||||
output_type:
|
||||
Identifier: "{\"id\":\"39\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":696,\\\"hi\\\":703}\"}"
|
||||
block:
|
||||
statements: []
|
||||
span:
|
||||
lo: 703
|
||||
hi: 704
|
||||
id: 41
|
||||
finalize: ~
|
||||
span:
|
||||
lo: 641
|
||||
hi: 704
|
||||
id: 42
|
||||
- - transfer_public
|
||||
- annotations: []
|
||||
variant: Transition
|
||||
identifier: "{\"id\":\"43\",\"name\":\"transfer_public\",\"span\":\"{\\\"lo\\\":721,\\\"hi\\\":736}\"}"
|
||||
input:
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"44\",\"name\":\"a1\",\"span\":\"{\\\"lo\\\":744,\\\"hi\\\":746}\"}"
|
||||
mode: Public
|
||||
type_: Address
|
||||
span:
|
||||
lo: 744
|
||||
hi: 746
|
||||
id: 45
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"46\",\"name\":\"a2\",\"span\":\"{\\\"lo\\\":764,\\\"hi\\\":766}\"}"
|
||||
mode: Public
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 764
|
||||
hi: 766
|
||||
id: 47
|
||||
output: []
|
||||
output_type: Unit
|
||||
block:
|
||||
statements: []
|
||||
span:
|
||||
lo: 772
|
||||
hi: 773
|
||||
id: 48
|
||||
finalize: ~
|
||||
span:
|
||||
lo: 710
|
||||
hi: 773
|
||||
id: 49
|
||||
- - transfer_private
|
||||
- annotations: []
|
||||
variant: Transition
|
||||
identifier: "{\"id\":\"50\",\"name\":\"transfer_private\",\"span\":\"{\\\"lo\\\":790,\\\"hi\\\":806}\"}"
|
||||
input:
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"51\",\"name\":\"a1\",\"span\":\"{\\\"lo\\\":807,\\\"hi\\\":809}\"}"
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"52\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":811,\\\"hi\\\":818}\"}"
|
||||
span:
|
||||
lo: 807
|
||||
hi: 809
|
||||
id: 53
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"54\",\"name\":\"a2\",\"span\":\"{\\\"lo\\\":820,\\\"hi\\\":822}\"}"
|
||||
mode: None
|
||||
type_: Address
|
||||
span:
|
||||
lo: 820
|
||||
hi: 822
|
||||
id: 55
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"56\",\"name\":\"a3\",\"span\":\"{\\\"lo\\\":833,\\\"hi\\\":835}\"}"
|
||||
mode: None
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 833
|
||||
hi: 835
|
||||
id: 57
|
||||
output:
|
||||
- Internal:
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"58\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":846,\\\"hi\\\":853}\"}"
|
||||
span:
|
||||
lo: 846
|
||||
hi: 853
|
||||
id: 59
|
||||
- Internal:
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"60\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":855,\\\"hi\\\":862}\"}"
|
||||
span:
|
||||
lo: 855
|
||||
hi: 862
|
||||
id: 61
|
||||
output_type:
|
||||
Tuple:
|
||||
- Identifier: "{\"id\":\"58\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":846,\\\"hi\\\":853}\"}"
|
||||
- Identifier: "{\"id\":\"60\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":855,\\\"hi\\\":862}\"}"
|
||||
block:
|
||||
statements: []
|
||||
span:
|
||||
lo: 863
|
||||
hi: 864
|
||||
id: 62
|
||||
finalize: ~
|
||||
span:
|
||||
lo: 779
|
||||
hi: 864
|
||||
id: 63
|
||||
- - transfer_private_to_public
|
||||
- annotations: []
|
||||
variant: Transition
|
||||
identifier: "{\"id\":\"64\",\"name\":\"transfer_private_to_public\",\"span\":\"{\\\"lo\\\":881,\\\"hi\\\":907}\"}"
|
||||
input:
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"65\",\"name\":\"a1\",\"span\":\"{\\\"lo\\\":908,\\\"hi\\\":910}\"}"
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"66\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":912,\\\"hi\\\":919}\"}"
|
||||
span:
|
||||
lo: 908
|
||||
hi: 910
|
||||
id: 67
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"68\",\"name\":\"a2\",\"span\":\"{\\\"lo\\\":928,\\\"hi\\\":930}\"}"
|
||||
mode: Public
|
||||
type_: Address
|
||||
span:
|
||||
lo: 928
|
||||
hi: 930
|
||||
id: 69
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"70\",\"name\":\"a3\",\"span\":\"{\\\"lo\\\":948,\\\"hi\\\":950}\"}"
|
||||
mode: Public
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 948
|
||||
hi: 950
|
||||
id: 71
|
||||
output:
|
||||
- Internal:
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"72\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":960,\\\"hi\\\":967}\"}"
|
||||
span:
|
||||
lo: 960
|
||||
hi: 967
|
||||
id: 73
|
||||
output_type:
|
||||
Identifier: "{\"id\":\"72\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":960,\\\"hi\\\":967}\"}"
|
||||
block:
|
||||
statements: []
|
||||
span:
|
||||
lo: 967
|
||||
hi: 968
|
||||
id: 74
|
||||
finalize: ~
|
||||
span:
|
||||
lo: 870
|
||||
hi: 968
|
||||
id: 75
|
||||
- - transfer_public_to_private
|
||||
- annotations: []
|
||||
variant: Transition
|
||||
identifier: "{\"id\":\"76\",\"name\":\"transfer_public_to_private\",\"span\":\"{\\\"lo\\\":985,\\\"hi\\\":1011}\"}"
|
||||
input:
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"77\",\"name\":\"a1\",\"span\":\"{\\\"lo\\\":1019,\\\"hi\\\":1021}\"}"
|
||||
mode: Public
|
||||
type_: Address
|
||||
span:
|
||||
lo: 1019
|
||||
hi: 1021
|
||||
id: 78
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"79\",\"name\":\"a2\",\"span\":\"{\\\"lo\\\":1039,\\\"hi\\\":1041}\"}"
|
||||
mode: Public
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 1039
|
||||
hi: 1041
|
||||
id: 80
|
||||
output:
|
||||
- Internal:
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"81\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1051,\\\"hi\\\":1058}\"}"
|
||||
span:
|
||||
lo: 1051
|
||||
hi: 1058
|
||||
id: 82
|
||||
output_type:
|
||||
Identifier: "{\"id\":\"81\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1051,\\\"hi\\\":1058}\"}"
|
||||
block:
|
||||
statements: []
|
||||
span:
|
||||
lo: 1058
|
||||
hi: 1059
|
||||
id: 83
|
||||
finalize: ~
|
||||
span:
|
||||
lo: 974
|
||||
hi: 1059
|
||||
id: 84
|
||||
- - join
|
||||
- annotations: []
|
||||
variant: Transition
|
||||
identifier: "{\"id\":\"85\",\"name\":\"join\",\"span\":\"{\\\"lo\\\":1076,\\\"hi\\\":1080}\"}"
|
||||
input:
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"86\",\"name\":\"a1\",\"span\":\"{\\\"lo\\\":1081,\\\"hi\\\":1083}\"}"
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"87\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1085,\\\"hi\\\":1092}\"}"
|
||||
span:
|
||||
lo: 1081
|
||||
hi: 1083
|
||||
id: 88
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"89\",\"name\":\"a2\",\"span\":\"{\\\"lo\\\":1094,\\\"hi\\\":1096}\"}"
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"90\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1098,\\\"hi\\\":1105}\"}"
|
||||
span:
|
||||
lo: 1094
|
||||
hi: 1096
|
||||
id: 91
|
||||
output:
|
||||
- Internal:
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"92\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1110,\\\"hi\\\":1117}\"}"
|
||||
span:
|
||||
lo: 1110
|
||||
hi: 1117
|
||||
id: 93
|
||||
output_type:
|
||||
Identifier: "{\"id\":\"92\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1110,\\\"hi\\\":1117}\"}"
|
||||
block:
|
||||
statements: []
|
||||
span:
|
||||
lo: 1117
|
||||
hi: 1118
|
||||
id: 94
|
||||
finalize: ~
|
||||
span:
|
||||
lo: 1065
|
||||
hi: 1118
|
||||
id: 95
|
||||
- - split
|
||||
- annotations: []
|
||||
variant: Transition
|
||||
identifier: "{\"id\":\"96\",\"name\":\"split\",\"span\":\"{\\\"lo\\\":1135,\\\"hi\\\":1140}\"}"
|
||||
input:
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"97\",\"name\":\"a1\",\"span\":\"{\\\"lo\\\":1141,\\\"hi\\\":1143}\"}"
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"98\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1145,\\\"hi\\\":1152}\"}"
|
||||
span:
|
||||
lo: 1141
|
||||
hi: 1143
|
||||
id: 99
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"100\",\"name\":\"a2\",\"span\":\"{\\\"lo\\\":1154,\\\"hi\\\":1156}\"}"
|
||||
mode: None
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 1154
|
||||
hi: 1156
|
||||
id: 101
|
||||
output:
|
||||
- Internal:
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"102\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1167,\\\"hi\\\":1174}\"}"
|
||||
span:
|
||||
lo: 1167
|
||||
hi: 1174
|
||||
id: 103
|
||||
- Internal:
|
||||
mode: None
|
||||
type_:
|
||||
Identifier: "{\"id\":\"104\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1176,\\\"hi\\\":1183}\"}"
|
||||
span:
|
||||
lo: 1176
|
||||
hi: 1183
|
||||
id: 105
|
||||
output_type:
|
||||
Tuple:
|
||||
- Identifier: "{\"id\":\"102\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1167,\\\"hi\\\":1174}\"}"
|
||||
- Identifier: "{\"id\":\"104\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1176,\\\"hi\\\":1183}\"}"
|
||||
block:
|
||||
statements: []
|
||||
span:
|
||||
lo: 1184
|
||||
hi: 1185
|
||||
id: 106
|
||||
finalize: ~
|
||||
span:
|
||||
lo: 1124
|
||||
hi: 1185
|
||||
id: 107
|
||||
- - foo
|
||||
- annotations: []
|
||||
variant: Standard
|
||||
identifier: "{\"id\":\"108\",\"name\":\"foo\",\"span\":\"{\\\"lo\\\":1200,\\\"hi\\\":1203}\"}"
|
||||
input: []
|
||||
output: []
|
||||
output_type: Unit
|
||||
block:
|
||||
statements:
|
||||
- Definition:
|
||||
declaration_type: Let
|
||||
place:
|
||||
Identifier: "{\"id\":\"109\",\"name\":\"a\",\"span\":\"{\\\"lo\\\":1219,\\\"hi\\\":1220}\"}"
|
||||
type_:
|
||||
Integer: U8
|
||||
value:
|
||||
Literal:
|
||||
Integer:
|
||||
- U8
|
||||
- "1"
|
||||
- span:
|
||||
lo: 1226
|
||||
hi: 1229
|
||||
- 110
|
||||
span:
|
||||
lo: 1215
|
||||
hi: 1229
|
||||
id: 111
|
||||
span:
|
||||
lo: 1206
|
||||
hi: 1236
|
||||
id: 112
|
||||
finalize:
|
||||
identifier: "{\"id\":\"113\",\"name\":\"foo\",\"span\":\"{\\\"lo\\\":1250,\\\"hi\\\":1253}\"}"
|
||||
input: []
|
||||
output: []
|
||||
output_type: Unit
|
||||
block:
|
||||
statements:
|
||||
- Definition:
|
||||
declaration_type: Let
|
||||
place:
|
||||
Identifier: "{\"id\":\"114\",\"name\":\"c\",\"span\":\"{\\\"lo\\\":1270,\\\"hi\\\":1271}\"}"
|
||||
type_:
|
||||
Integer: U8
|
||||
value:
|
||||
Literal:
|
||||
Integer:
|
||||
- U8
|
||||
- "1"
|
||||
- span:
|
||||
lo: 1277
|
||||
hi: 1280
|
||||
- 115
|
||||
span:
|
||||
lo: 1266
|
||||
hi: 1280
|
||||
id: 116
|
||||
span:
|
||||
lo: 1256
|
||||
hi: 1287
|
||||
id: 117
|
||||
span:
|
||||
lo: 1241
|
||||
hi: 1287
|
||||
id: 118
|
||||
span:
|
||||
lo: 1191
|
||||
hi: 1236
|
||||
id: 119
|
||||
span:
|
||||
lo: 2
|
||||
hi: 1289
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"121\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
functions:
|
||||
- - foo
|
||||
- annotations: []
|
||||
variant: Transition
|
||||
identifier: "{\"id\":\"122\",\"name\":\"foo\",\"span\":\"{\\\"lo\\\":1326,\\\"hi\\\":1329}\"}"
|
||||
input:
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"123\",\"name\":\"arg1\",\"span\":\"{\\\"lo\\\":1330,\\\"hi\\\":1334}\"}"
|
||||
mode: None
|
||||
type_: Address
|
||||
span:
|
||||
lo: 1330
|
||||
hi: 1334
|
||||
id: 124
|
||||
- Internal:
|
||||
identifier: "{\"id\":\"125\",\"name\":\"arg1\",\"span\":\"{\\\"lo\\\":1345,\\\"hi\\\":1349}\"}"
|
||||
mode: None
|
||||
type_:
|
||||
Integer: U64
|
||||
span:
|
||||
lo: 1345
|
||||
hi: 1349
|
||||
id: 126
|
||||
output: []
|
||||
output_type: Unit
|
||||
block:
|
||||
statements:
|
||||
- Expression:
|
||||
expression:
|
||||
Call:
|
||||
function:
|
||||
Identifier: "{\"id\":\"128\",\"name\":\"transfer_public\",\"span\":\"{\\\"lo\\\":1379,\\\"hi\\\":1394}\"}"
|
||||
arguments:
|
||||
- Identifier: "{\"id\":\"129\",\"name\":\"arg1\",\"span\":\"{\\\"lo\\\":1395,\\\"hi\\\":1399}\"}"
|
||||
- Identifier: "{\"id\":\"130\",\"name\":\"arg2\",\"span\":\"{\\\"lo\\\":1401,\\\"hi\\\":1405}\"}"
|
||||
external:
|
||||
Identifier: "{\"id\":\"127\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1366,\\\"hi\\\":1373}\"}"
|
||||
span:
|
||||
lo: 1366
|
||||
hi: 1406
|
||||
id: 131
|
||||
span:
|
||||
lo: 1366
|
||||
hi: 1407
|
||||
id: 132
|
||||
- Expression:
|
||||
expression:
|
||||
Call:
|
||||
function:
|
||||
Identifier: "{\"id\":\"134\",\"name\":\"transfer_public\",\"span\":\"{\\\"lo\\\":1428,\\\"hi\\\":1443}\"}"
|
||||
arguments:
|
||||
- Identifier: "{\"id\":\"135\",\"name\":\"arg1\",\"span\":\"{\\\"lo\\\":1444,\\\"hi\\\":1448}\"}"
|
||||
- Identifier: "{\"id\":\"136\",\"name\":\"arg2\",\"span\":\"{\\\"lo\\\":1450,\\\"hi\\\":1454}\"}"
|
||||
external:
|
||||
Identifier: "{\"id\":\"133\",\"name\":\"credits\",\"span\":\"{\\\"lo\\\":1416,\\\"hi\\\":1423}\"}"
|
||||
span:
|
||||
lo: 1416
|
||||
hi: 1455
|
||||
id: 137
|
||||
span:
|
||||
lo: 1416
|
||||
hi: 1456
|
||||
id: 138
|
||||
span:
|
||||
lo: 1356
|
||||
hi: 1462
|
||||
id: 139
|
||||
finalize: ~
|
||||
span:
|
||||
lo: 1315
|
||||
hi: 1462
|
||||
id: 140
|
||||
span:
|
||||
lo: 1291
|
||||
hi: 1464
|
5
tests/expectations/parser/program/stub_fail.out
Normal file
5
tests/expectations/parser/program/stub_fail.out
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [EPAR0370034]: Empty functions cannot have finalize functions attached to them.\n --> test:7:14\n |\n 7 | finalize foo() {\n | ^^^"
|
@ -3,9 +3,10 @@ namespace: Serialize
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -3,9 +3,10 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- imports: {}
|
||||
stubs: {}
|
||||
program_scopes:
|
||||
test:
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":15,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":19}\\\\\\\"}\\\"\"}"
|
||||
program_id: "{\"name\":\"test\",\"network\":\"\\\"{\\\\\\\"id\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"name\\\\\\\":\\\\\\\"aleo\\\\\\\",\\\\\\\"span\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"lo\\\\\\\\\\\\\\\":0,\\\\\\\\\\\\\\\"hi\\\\\\\\\\\\\\\":0}\\\\\\\"}\\\"\"}"
|
||||
consts: []
|
||||
structs: []
|
||||
mappings: []
|
||||
|
@ -0,0 +1,17 @@
|
||||
/*
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
stub foo.aleo {
|
||||
transition foo(x: u32, y: i32);
|
||||
finalize foo() {
|
||||
let a:u8 = 1u8;
|
||||
}
|
||||
}
|
||||
|
||||
program test.aleo {
|
||||
transition doo(x: u32, y: i32) -> u32 {
|
||||
return 0u32;
|
||||
}
|
||||
}
|
10
tests/tests/parser/program/non_aleo_network_fail.leo
Normal file
10
tests/tests/parser/program/non_aleo_network_fail.leo
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
program test.eth {
|
||||
transition doo(x: u32, y: i32) -> u32 {
|
||||
return 0u32;
|
||||
}
|
||||
}
|
58
tests/tests/parser/program/stub.leo
Normal file
58
tests/tests/parser/program/stub.leo
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
stub credits.aleo {
|
||||
record credits {
|
||||
owner: address,
|
||||
micrcredits: u64,
|
||||
}
|
||||
struct Row {
|
||||
c1: u8,
|
||||
c2: u8,
|
||||
c3: u8
|
||||
}
|
||||
mapping num_winners: u8 => u8;
|
||||
|
||||
record board_state {
|
||||
owner: address,
|
||||
// The hits and misses registered on the opponent's board.
|
||||
hits_and_misses: u64,
|
||||
// The squares that have been played on the opponent's board.
|
||||
played_tiles: u64,
|
||||
// The ship bitstring representing all ship positions on your own board
|
||||
ships: u64,
|
||||
player_1: address,
|
||||
player_2: address,
|
||||
game_started: bool,
|
||||
}
|
||||
|
||||
transition mint(public a1: address, public a2: u64) -> credits;
|
||||
|
||||
transition transfer_public(public a1: address, public a2: u64);
|
||||
|
||||
transition transfer_private(a1: credits, a2: address, a3: u64) -> (credits, credits);
|
||||
|
||||
transition transfer_private_to_public(a1: credits, public a2: address, public a3: u64) -> credits;
|
||||
|
||||
transition transfer_public_to_private(public a1: address, public a2: u64) -> credits;
|
||||
|
||||
transition join(a1: credits, a2: credits) -> credits;
|
||||
|
||||
transition split(a1: credits, a2: u64) -> (credits, credits);
|
||||
|
||||
function foo() {
|
||||
let a:u8 = 1u8;
|
||||
}
|
||||
finalize foo() {
|
||||
let c:u8 = 1u8;
|
||||
}
|
||||
}
|
||||
|
||||
program test.aleo {
|
||||
transition foo(arg1: address, arg1: u64) {
|
||||
credits.aleo/transfer_public(arg1, arg2);
|
||||
credits.leo/transfer_public(arg1, arg2);
|
||||
}
|
||||
}
|
26
tests/tests/parser/program/stub_fail.leo
Normal file
26
tests/tests/parser/program/stub_fail.leo
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
stub credits.aleo {
|
||||
transition split(a1: credits, a2: u64) -> (credits, credits) {}
|
||||
|
||||
function foo();
|
||||
finalize foo() {
|
||||
let c:u8 = 1u8;
|
||||
}
|
||||
}
|
||||
|
||||
stub big.leo {
|
||||
transition split(a1: credits, a2: u64) -> (credits, credits) {
|
||||
credits.aleo/split(a1, a2);
|
||||
}
|
||||
}
|
||||
|
||||
program test.aleo {
|
||||
transition foo(arg1: address, arg1: u64) {
|
||||
credits.aleo/transfer_public(arg1, arg2);
|
||||
credits.leo/transfer_public(arg1, arg2);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user