feat(parser): add support for and/or chaining
This commit is contained in:
@@ -945,12 +945,12 @@ fn trace_non_strings() {
|
||||
#[test]
|
||||
fn trace_if_false_ok() {
|
||||
let source_code = r#"
|
||||
fn or(a: Bool, b: Bool) {
|
||||
fn or_func(a: Bool, b: Bool) {
|
||||
(a || b)?
|
||||
}
|
||||
|
||||
test foo() {
|
||||
or(True, False)?
|
||||
or_func(True, False)?
|
||||
}
|
||||
|
||||
test bar() {
|
||||
|
||||
@@ -250,7 +250,7 @@ fn format_nested_function_calls() {
|
||||
_ -> fail "expected inline datum"
|
||||
},
|
||||
]
|
||||
|> list.and
|
||||
|> list.and_func
|
||||
}
|
||||
"#
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
source: crates/aiken-lang/src/tests/format.rs
|
||||
description: "Code:\n\nfn foo(output) {\n [\n output.address.stake_credential == Some(\n Inline(\n VerificationKeyCredential(\n #\"66666666666666666666666666666666666666666666666666666666\",\n ))\n )\n ,\n when output.datum is {\n InlineDatum(_) -> True\n _ -> fail \"expected inline datum\"\n },\n ]\n |> list.and\n}\n"
|
||||
description: "Code:\n\nfn foo(output) {\n [\n output.address.stake_credential == Some(\n Inline(\n VerificationKeyCredential(\n #\"66666666666666666666666666666666666666666666666666666666\",\n ))\n )\n ,\n when output.datum is {\n InlineDatum(_) -> True\n _ -> fail \"expected inline datum\"\n },\n ]\n |> list.and_func\n}\n"
|
||||
---
|
||||
fn foo(output) {
|
||||
[
|
||||
@@ -16,6 +16,6 @@ fn foo(output) {
|
||||
_ -> fail @"expected inline datum"
|
||||
},
|
||||
]
|
||||
|> list.and
|
||||
|> list.and_func
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user