mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-25 19:22:01 +03:00
Merge pull request #446 from AleoHQ/fix/input-tuple
fix input tuple grammar rule
This commit is contained in:
commit
25c9ac6ea2
@ -174,3 +174,13 @@ fn test_return_array_tuple_pass() {
|
||||
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
||||
// Test return tuples
|
||||
|
||||
#[test]
|
||||
fn test_return_tuple() {
|
||||
let bytes = include_bytes!("return_tuple.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
assert_satisfied(program);
|
||||
}
|
||||
|
11
compiler/tests/function/return_tuple.leo
Normal file
11
compiler/tests/function/return_tuple.leo
Normal file
@ -0,0 +1,11 @@
|
||||
// Returns a tuple of tuples.
|
||||
function tuples() -> ((u8, u8), u32) {
|
||||
let a: (u8, u8) = (1, 2);
|
||||
let b: u32 = 3;
|
||||
|
||||
return (a, b)
|
||||
}
|
||||
|
||||
function main() {
|
||||
let t = tuples();
|
||||
}
|
@ -105,7 +105,7 @@ dimension_single = {
|
||||
// Declared in types/array_dimensions.rs
|
||||
dimension_multiple = { "(" ~ number_positive ~ ("," ~ number_positive)* ~ ")"}
|
||||
|
||||
type_tuple = { "(" ~ type_ ~ ("," ~ (type_tuple | type_))+ ~ ")" }
|
||||
type_tuple = { "(" ~ NEWLINE* ~ (type_ ~ ("," ~ NEWLINE* ~ type_)+ ~ ","?)? ~ NEWLINE* ~ ")" }
|
||||
|
||||
/// Values
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user