mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-10-26 07:00:35 +03:00
Update parser tests
This commit is contained in:
parent
2329617fec
commit
047ed7a08b
@ -2,35 +2,37 @@
|
||||
namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
// test1
|
||||
|
||||
// test2
|
||||
|
||||
//test3
|
||||
|
||||
// test4
|
||||
|
||||
/* test5 */
|
||||
|
||||
/*
|
||||
test 6 */
|
||||
|
||||
/* test 7
|
||||
*/
|
||||
|
||||
/*test8 */
|
||||
|
||||
/* test9*/
|
||||
|
||||
/*test10*/
|
||||
|
||||
/*/**/
|
||||
|
||||
/**/
|
||||
|
||||
/*//*/
|
||||
|
||||
/** /*/
|
||||
|
||||
/** **/
|
||||
|
||||
program test.aleo {
|
||||
// test1
|
||||
|
||||
// test2
|
||||
|
||||
//test3
|
||||
|
||||
// test4
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,18 +3,20 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
program test.aleo {
|
||||
function main() -> bool {
|
||||
|
||||
}
|
||||
|
||||
finalize main() {
|
||||
|
||||
}
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
} finalize main(a: foo, b: bar) -> baz {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
finalize main() {
|
||||
|
||||
}
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
} finalize main(a: foo, b: bar) -> baz {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,28 +3,30 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
} finalize {
|
||||
|
||||
program test.aleo {
|
||||
function main() -> bool {
|
||||
|
||||
} finalize {
|
||||
|
||||
}
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
} finalize() {
|
||||
|
||||
}
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
} finalie() {
|
||||
|
||||
}
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
} finalize main() floo {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
} finalize() {
|
||||
|
||||
}
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
} finalie() {
|
||||
|
||||
}
|
||||
|
||||
function main() -> bool {
|
||||
|
||||
} finalize main() floo {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,6 +3,8 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
mapping foo: bar => baz;
|
||||
|
||||
mapping foo: u8 => u8;
|
||||
program test.aleo {
|
||||
mapping foo: bar => baz;
|
||||
|
||||
mapping foo: u8 => u8;
|
||||
}
|
||||
|
@ -3,12 +3,14 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
mapping u8: u8 => u8;
|
||||
|
||||
mapping foo: bar -> baz;
|
||||
|
||||
mapping foo: (bar => baz);
|
||||
|
||||
mapping foo: [bar -> baz];
|
||||
|
||||
mapping foo bar => baz;
|
||||
program test.aleo {
|
||||
mapping u8: u8 => u8;
|
||||
|
||||
mapping foo: bar -> baz;
|
||||
|
||||
mapping foo: (bar => baz);
|
||||
|
||||
mapping foo: [bar -> baz];
|
||||
|
||||
mapping foo bar => baz;
|
||||
}
|
||||
|
@ -3,18 +3,20 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
@foo(?, bar, ?)
|
||||
function x() -> u8 {
|
||||
return 1u8;
|
||||
}
|
||||
|
||||
@bar(123) // ints not vali
|
||||
function x() -> u8 {
|
||||
return 2u8;
|
||||
}
|
||||
|
||||
|
||||
@context // recovery witness
|
||||
function x() -> u8 {
|
||||
return 3u8;
|
||||
program test.aleo {
|
||||
@foo(?, bar, ?)
|
||||
function x() -> u8 {
|
||||
return 1u8;
|
||||
}
|
||||
|
||||
@bar(123) // ints not vali
|
||||
function x() -> u8 {
|
||||
return 2u8;
|
||||
}
|
||||
|
||||
|
||||
@context // recovery witness
|
||||
function x() -> u8 {
|
||||
return 3u8;
|
||||
}
|
||||
}
|
||||
|
@ -3,12 +3,14 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
@context
|
||||
function f() -> u8 {
|
||||
return 1u8;
|
||||
}
|
||||
|
||||
@context // recovery witness
|
||||
function g() -> u8 {
|
||||
return 2u8;
|
||||
program test.aleo {
|
||||
@context
|
||||
function f() -> u8 {
|
||||
return 1u8;
|
||||
}
|
||||
|
||||
@context // recovery witness
|
||||
function g() -> u8 {
|
||||
return 2u8;
|
||||
}
|
||||
}
|
||||
|
@ -3,15 +3,17 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
@foo
|
||||
@bar
|
||||
@baz
|
||||
function foo() -> u8 {}
|
||||
|
||||
transition mint() -> u8 {}
|
||||
|
||||
@test
|
||||
function test() -> u8 {}
|
||||
|
||||
@program
|
||||
function foo() -> u8 {}
|
||||
program test.aleo {
|
||||
@foo
|
||||
@bar
|
||||
@baz
|
||||
function foo() -> u8 {}
|
||||
|
||||
transition mint() -> u8 {}
|
||||
|
||||
@test
|
||||
function test() -> u8 {}
|
||||
|
||||
@program
|
||||
function foo() -> u8 {}
|
||||
}
|
||||
|
@ -3,13 +3,15 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function x(constant y: u32) -> u8 {
|
||||
if y < 5u32 {
|
||||
x(y+1u32);
|
||||
program test.aleo {
|
||||
function x(constant y: u32) -> u8 {
|
||||
if y < 5u32 {
|
||||
x(y+1u32);
|
||||
}
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
x(1u32);
|
||||
return y;
|
||||
}
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
x(1u32);
|
||||
return y;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
function x(const x: u8) -> u8 {}
|
||||
|
||||
function y(constant y: u64) -> u8 {}
|
||||
program test.aleo {
|
||||
function x(const x: u8) -> u8 {}
|
||||
|
||||
function y(constant y: u64) -> u8 {}}
|
||||
|
@ -3,10 +3,11 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
function x(x: u32, constant y: i32) -> u8 {
|
||||
return 0u8;
|
||||
}
|
||||
|
||||
function x(constant x: u32, y: i32) -> u8 {
|
||||
return 0u8;
|
||||
}
|
||||
program test.aleo {
|
||||
function x(x: u32, constant y: i32) -> u8 {
|
||||
return 0u8;
|
||||
}
|
||||
|
||||
function x(constant x: u32, y: i32) -> u8 {
|
||||
return 0u8;
|
||||
}}
|
||||
|
@ -3,10 +3,11 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function x(x: u32, const public y: i32) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function x(constant public x: u32, y: i32) {
|
||||
return 0;
|
||||
}
|
||||
program test.aleo {
|
||||
function x(x: u32, const public y: i32) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function x(constant public x: u32, y: i32) {
|
||||
return 0;
|
||||
}}
|
||||
|
@ -3,7 +3,9 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
// This test currently passes, but we should disallow dangling annotations.
|
||||
@test
|
||||
|
||||
function test() -> u8 {}
|
||||
program test.aleo {
|
||||
// This test currently passes, but we should disallow dangling annotations.
|
||||
@test
|
||||
|
||||
function test() -> u8 {}
|
||||
}
|
||||
|
@ -3,4 +3,5 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
function x() -> u8 {}
|
||||
program test.aleo {
|
||||
function x() -> u8 {}}
|
||||
|
@ -3,7 +3,8 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
\
|
||||
program test.aleo {
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
\}
|
||||
|
@ -3,4 +3,5 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
1 main() {}
|
||||
program test.aleo {
|
||||
1 main() {}}
|
||||
|
@ -3,11 +3,13 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function inf() -> u8 {
|
||||
inf();
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
inf();
|
||||
return y;
|
||||
program test.aleo {
|
||||
function inf() -> u8 {
|
||||
inf();
|
||||
}
|
||||
|
||||
function main(y: bool) -> bool {
|
||||
inf();
|
||||
return y;
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,5 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function f(mut a: u8) {}
|
||||
program test.aleo {
|
||||
function f(mut a: u8) {}}
|
||||
|
@ -3,6 +3,7 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
function x(x: u32, y: i32) -> u8 {
|
||||
return 0u8;
|
||||
}
|
||||
program test.aleo {
|
||||
function x(x: u32, y: i32) -> u8 {
|
||||
return 0u8;
|
||||
}}
|
||||
|
@ -3,6 +3,7 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
function x(x: u32, y: i32) -> u32 {
|
||||
return 0u8;
|
||||
}
|
||||
program test.aleo {
|
||||
function x(x: u32, y: i32) -> u32 {
|
||||
return 0u8;
|
||||
}}
|
||||
|
@ -3,10 +3,11 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function x(x: u32, public const y: i32) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function x(public constant x: u32, y: i32) {
|
||||
return 0;
|
||||
}
|
||||
program test.aleo {
|
||||
function x(x: u32, public const y: i32) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function x(public constant x: u32, y: i32) {
|
||||
return 0;
|
||||
}}
|
||||
|
@ -3,10 +3,12 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
function x(x: u32, public y: i32) -> u8 {
|
||||
return 0u8;
|
||||
}
|
||||
|
||||
function x(public x: u32, y: i32) -> u8 {
|
||||
return 0u8;
|
||||
program test.aleo {
|
||||
function x(x: u32, public y: i32) -> u8 {
|
||||
return 0u8;
|
||||
}
|
||||
|
||||
function x(public x: u32, y: i32) -> u8 {
|
||||
return 0u8;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
function x() -> u32 {
|
||||
return 0u8;
|
||||
}
|
||||
program test.aleo {
|
||||
function x() -> u32 {
|
||||
return 0u8;
|
||||
}}
|
||||
|
@ -3,5 +3,7 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
@ test
|
||||
function test() -> u8 {}
|
||||
program test.aleo {
|
||||
@ test
|
||||
function test() -> u8 {}
|
||||
}
|
||||
|
@ -3,4 +3,5 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
test main() {}
|
||||
program test.aleo {
|
||||
test main() {}}
|
||||
|
@ -3,7 +3,8 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
\
|
||||
program test.aleo {
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
\}
|
||||
|
@ -2,8 +2,10 @@
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
/* next line starts with 2069
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
function main() {
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,9 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
// 202E<-here
|
||||
let x = 1u8;
|
||||
program test.aleo {
|
||||
function main() {
|
||||
// 202E<-here
|
||||
let x = 1u8;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,8 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
|
||||
circuit Foo {
|
||||
a: u8;
|
||||
}
|
||||
program test.aleo {
|
||||
|
||||
circuit Foo {
|
||||
a: u8;
|
||||
}}
|
||||
|
@ -3,7 +3,8 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
$
|
||||
program test.aleo {
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
$}
|
||||
|
@ -3,7 +3,8 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
\1u8
|
||||
program test.aleo {
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
\1u8}
|
||||
|
@ -3,4 +3,5 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() { let a = 0x
|
||||
program test.aleo {
|
||||
function main() { let a = 0x}
|
||||
|
@ -3,6 +3,8 @@ namespace: Parse
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
mapping balances: address => u128;
|
||||
|
||||
mapping foo: bar => baz;
|
||||
program test.aleo {
|
||||
mapping balances: address => u128;
|
||||
|
||||
mapping foo: bar => baz;
|
||||
}
|
||||
|
@ -3,8 +3,10 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
mappin balances: address => u128;
|
||||
|
||||
mapping foo: bar -> baz;
|
||||
|
||||
mapping foo bar => baz;
|
||||
program test.aleo {
|
||||
mappin balances: address => u128;
|
||||
|
||||
mapping foo: bar -> baz;
|
||||
|
||||
mapping foo bar => baz;
|
||||
}
|
||||
|
@ -3,7 +3,8 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
|
|
||||
program test.aleo {
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
|}
|
||||
|
@ -3,7 +3,8 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
"
|
||||
program test.aleo {
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
"}
|
||||
|
@ -3,7 +3,8 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
'
|
||||
program test.aleo {
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
'}
|
||||
|
@ -3,7 +3,8 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
~
|
||||
program test.aleo {
|
||||
function main() {
|
||||
let x = 1u8;
|
||||
}
|
||||
~}
|
||||
|
@ -3,5 +3,6 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function main(s1: [char; 13], s2: [char; 4]) -> bool {
|
||||
let d: char = '\u
|
||||
program test.aleo {
|
||||
function main(s1: [char; 13], s2: [char; 4]) -> bool {
|
||||
let d: char = '\u}
|
||||
|
@ -3,7 +3,9 @@ namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
function foo() {
|
||||
let mut x = 0;
|
||||
let mut y = 0; // recovery witness
|
||||
program test.aleo {
|
||||
function foo() {
|
||||
let mut x = 0;
|
||||
let mut y = 0; // recovery witness
|
||||
}
|
||||
}
|
||||
|
@ -2,107 +2,108 @@
|
||||
namespace: Parse
|
||||
expectation: Fail
|
||||
*/
|
||||
|
||||
struct ;
|
||||
|
||||
struct .
|
||||
|
||||
struct import
|
||||
|
||||
struct ,
|
||||
|
||||
struct *
|
||||
|
||||
struct +
|
||||
|
||||
struct -
|
||||
|
||||
struct /
|
||||
|
||||
struct [
|
||||
|
||||
struct ]
|
||||
|
||||
struct {
|
||||
|
||||
struct }
|
||||
|
||||
struct (
|
||||
|
||||
struct )
|
||||
|
||||
struct :
|
||||
|
||||
struct ::
|
||||
|
||||
struct ?
|
||||
|
||||
struct _
|
||||
|
||||
struct =
|
||||
|
||||
struct ==
|
||||
|
||||
struct !
|
||||
|
||||
struct !=
|
||||
|
||||
struct >
|
||||
|
||||
struct >=
|
||||
|
||||
struct <
|
||||
|
||||
struct <=
|
||||
|
||||
struct >
|
||||
|
||||
struct ..
|
||||
|
||||
struct as
|
||||
|
||||
struct console
|
||||
|
||||
struct const
|
||||
|
||||
struct let
|
||||
|
||||
struct for
|
||||
|
||||
struct if
|
||||
|
||||
struct else
|
||||
|
||||
struct i8
|
||||
|
||||
struct i16
|
||||
|
||||
struct i32
|
||||
|
||||
struct i64
|
||||
|
||||
struct i128
|
||||
|
||||
struct u8
|
||||
|
||||
struct u16
|
||||
|
||||
struct u32
|
||||
|
||||
struct u64
|
||||
|
||||
struct u128
|
||||
|
||||
struct &
|
||||
|
||||
struct return
|
||||
|
||||
struct self
|
||||
|
||||
struct Self
|
||||
|
||||
struct true
|
||||
|
||||
struct false
|
||||
|
||||
struct 0
|
||||
program test.aleo {
|
||||
struct ;
|
||||
|
||||
struct .
|
||||
|
||||
|
||||
struct ,
|
||||
|
||||
struct *
|
||||
|
||||
struct +
|
||||
|
||||
struct -
|
||||
|
||||
struct /
|
||||
|
||||
struct [
|
||||
|
||||
struct ]
|
||||
|
||||
struct {
|
||||
|
||||
struct }
|
||||
|
||||
struct (
|
||||
|
||||
struct )
|
||||
|
||||
struct :
|
||||
|
||||
struct ::
|
||||
|
||||
struct ?
|
||||
|
||||
struct _
|
||||
|
||||
struct =
|
||||
|
||||
struct ==
|
||||
|
||||
struct !
|
||||
|
||||
struct !=
|
||||
|
||||
struct >
|
||||
|
||||
struct >=
|
||||
|
||||
struct <
|
||||
|
||||
struct <=
|
||||
|
||||
struct >
|
||||
|
||||
struct ..
|
||||
|
||||
struct as
|
||||
|
||||
struct console
|
||||
|
||||
struct const
|
||||
|
||||
struct let
|
||||
|
||||
struct for
|
||||
|
||||
struct if
|
||||
|
||||
struct else
|
||||
|
||||
struct i8
|
||||
|
||||
struct i16
|
||||
|
||||
struct i32
|
||||
|
||||
struct i64
|
||||
|
||||
struct i128
|
||||
|
||||
struct u8
|
||||
|
||||
struct u16
|
||||
|
||||
struct u32
|
||||
|
||||
struct u64
|
||||
|
||||
struct u128
|
||||
|
||||
struct &
|
||||
|
||||
struct return
|
||||
|
||||
struct self
|
||||
|
||||
struct Self
|
||||
|
||||
struct true
|
||||
|
||||
struct false
|
||||
|
||||
struct 0}
|
||||
|
Loading…
Reference in New Issue
Block a user