test: new snapshots for parsing v3 validators
This commit is contained in:
parent
0d8d80e5a7
commit
6b8be61b6e
|
@ -1,22 +1,23 @@
|
||||||
---
|
---
|
||||||
source: crates/aiken-lang/src/parser/definition/validator.rs
|
source: crates/aiken-lang/src/parser/definition/validator.rs
|
||||||
description: "Code:\n\nvalidator {\n fn foo(datum, rdmr, ctx) {\n True\n }\n\n fn bar(rdmr, ctx) {\n True\n }\n}\n"
|
description: "Code:\n\nvalidator thing {\n spend (datum, rdmr, ctx) {\n True\n }\n\n mint (rdmr, ctx) {\n True\n }\n}\n"
|
||||||
---
|
---
|
||||||
Validator(
|
Validator(
|
||||||
Validator {
|
Validator {
|
||||||
doc: None,
|
doc: None,
|
||||||
end_position: 90,
|
end_position: 95,
|
||||||
fun: Function {
|
handlers: [
|
||||||
|
Function {
|
||||||
arguments: [
|
arguments: [
|
||||||
UntypedArg {
|
UntypedArg {
|
||||||
by: ByName(
|
by: ByName(
|
||||||
Named {
|
Named {
|
||||||
name: "datum",
|
name: "datum",
|
||||||
label: "datum",
|
label: "datum",
|
||||||
location: 21..26,
|
location: 27..32,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
location: 21..26,
|
location: 27..32,
|
||||||
annotation: None,
|
annotation: None,
|
||||||
doc: None,
|
doc: None,
|
||||||
is_validator_param: false,
|
is_validator_param: false,
|
||||||
|
@ -26,10 +27,10 @@ Validator(
|
||||||
Named {
|
Named {
|
||||||
name: "rdmr",
|
name: "rdmr",
|
||||||
label: "rdmr",
|
label: "rdmr",
|
||||||
location: 28..32,
|
location: 34..38,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
location: 28..32,
|
location: 34..38,
|
||||||
annotation: None,
|
annotation: None,
|
||||||
doc: None,
|
doc: None,
|
||||||
is_validator_param: false,
|
is_validator_param: false,
|
||||||
|
@ -39,29 +40,28 @@ Validator(
|
||||||
Named {
|
Named {
|
||||||
name: "ctx",
|
name: "ctx",
|
||||||
label: "ctx",
|
label: "ctx",
|
||||||
location: 34..37,
|
location: 40..43,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
location: 34..37,
|
location: 40..43,
|
||||||
annotation: None,
|
annotation: None,
|
||||||
doc: None,
|
doc: None,
|
||||||
is_validator_param: false,
|
is_validator_param: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
body: Var {
|
body: Var {
|
||||||
location: 45..49,
|
location: 51..55,
|
||||||
name: "True",
|
name: "True",
|
||||||
},
|
},
|
||||||
doc: None,
|
doc: None,
|
||||||
location: 14..38,
|
location: 26..44,
|
||||||
name: "foo",
|
name: "spend",
|
||||||
public: false,
|
public: true,
|
||||||
return_annotation: None,
|
return_annotation: None,
|
||||||
return_type: (),
|
return_type: (),
|
||||||
end_position: 52,
|
end_position: 58,
|
||||||
on_test_failure: FailImmediately,
|
on_test_failure: FailImmediately,
|
||||||
},
|
},
|
||||||
other_fun: Some(
|
|
||||||
Function {
|
Function {
|
||||||
arguments: [
|
arguments: [
|
||||||
UntypedArg {
|
UntypedArg {
|
||||||
|
@ -69,10 +69,10 @@ Validator(
|
||||||
Named {
|
Named {
|
||||||
name: "rdmr",
|
name: "rdmr",
|
||||||
label: "rdmr",
|
label: "rdmr",
|
||||||
location: 64..68,
|
location: 69..73,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
location: 64..68,
|
location: 69..73,
|
||||||
annotation: None,
|
annotation: None,
|
||||||
doc: None,
|
doc: None,
|
||||||
is_validator_param: false,
|
is_validator_param: false,
|
||||||
|
@ -82,30 +82,59 @@ Validator(
|
||||||
Named {
|
Named {
|
||||||
name: "ctx",
|
name: "ctx",
|
||||||
label: "ctx",
|
label: "ctx",
|
||||||
location: 70..73,
|
location: 75..78,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
location: 70..73,
|
location: 75..78,
|
||||||
annotation: None,
|
annotation: None,
|
||||||
doc: None,
|
doc: None,
|
||||||
is_validator_param: false,
|
is_validator_param: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
body: Var {
|
body: Var {
|
||||||
location: 81..85,
|
location: 86..90,
|
||||||
name: "True",
|
name: "True",
|
||||||
},
|
},
|
||||||
doc: None,
|
doc: None,
|
||||||
location: 57..74,
|
location: 68..79,
|
||||||
name: "bar",
|
name: "mint",
|
||||||
public: false,
|
public: true,
|
||||||
return_annotation: None,
|
return_annotation: None,
|
||||||
return_type: (),
|
return_type: (),
|
||||||
end_position: 88,
|
end_position: 93,
|
||||||
on_test_failure: FailImmediately,
|
on_test_failure: FailImmediately,
|
||||||
},
|
},
|
||||||
),
|
],
|
||||||
location: 0..9,
|
location: 0..9,
|
||||||
|
name: "thing",
|
||||||
params: [],
|
params: [],
|
||||||
|
fallback: Function {
|
||||||
|
arguments: [
|
||||||
|
UntypedArg {
|
||||||
|
by: ByName(
|
||||||
|
Discarded {
|
||||||
|
name: "_ctx",
|
||||||
|
label: "_ctx",
|
||||||
|
location: 0..0,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
location: 0..0,
|
||||||
|
annotation: None,
|
||||||
|
doc: None,
|
||||||
|
is_validator_param: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
body: ErrorTerm {
|
||||||
|
location: 0..0,
|
||||||
|
},
|
||||||
|
doc: None,
|
||||||
|
location: 0..0,
|
||||||
|
name: "fallback",
|
||||||
|
public: true,
|
||||||
|
return_annotation: None,
|
||||||
|
return_type: (),
|
||||||
|
end_position: 95,
|
||||||
|
on_test_failure: FailImmediately,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,140 @@
|
||||||
|
---
|
||||||
|
source: crates/aiken-lang/src/parser/definition/validator.rs
|
||||||
|
description: "Code:\n\nvalidator thing {\n spend (datum, rdmr, ctx) {\n True\n }\n\n mint (rdmr, ctx) {\n True\n }\n\n else (_) {\n fail\n }\n}\n"
|
||||||
|
---
|
||||||
|
Validator(
|
||||||
|
Validator {
|
||||||
|
doc: None,
|
||||||
|
end_position: 122,
|
||||||
|
handlers: [
|
||||||
|
Function {
|
||||||
|
arguments: [
|
||||||
|
UntypedArg {
|
||||||
|
by: ByName(
|
||||||
|
Named {
|
||||||
|
name: "datum",
|
||||||
|
label: "datum",
|
||||||
|
location: 27..32,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
location: 27..32,
|
||||||
|
annotation: None,
|
||||||
|
doc: None,
|
||||||
|
is_validator_param: false,
|
||||||
|
},
|
||||||
|
UntypedArg {
|
||||||
|
by: ByName(
|
||||||
|
Named {
|
||||||
|
name: "rdmr",
|
||||||
|
label: "rdmr",
|
||||||
|
location: 34..38,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
location: 34..38,
|
||||||
|
annotation: None,
|
||||||
|
doc: None,
|
||||||
|
is_validator_param: false,
|
||||||
|
},
|
||||||
|
UntypedArg {
|
||||||
|
by: ByName(
|
||||||
|
Named {
|
||||||
|
name: "ctx",
|
||||||
|
label: "ctx",
|
||||||
|
location: 40..43,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
location: 40..43,
|
||||||
|
annotation: None,
|
||||||
|
doc: None,
|
||||||
|
is_validator_param: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
body: Var {
|
||||||
|
location: 51..55,
|
||||||
|
name: "True",
|
||||||
|
},
|
||||||
|
doc: None,
|
||||||
|
location: 26..44,
|
||||||
|
name: "spend",
|
||||||
|
public: true,
|
||||||
|
return_annotation: None,
|
||||||
|
return_type: (),
|
||||||
|
end_position: 58,
|
||||||
|
on_test_failure: FailImmediately,
|
||||||
|
},
|
||||||
|
Function {
|
||||||
|
arguments: [
|
||||||
|
UntypedArg {
|
||||||
|
by: ByName(
|
||||||
|
Named {
|
||||||
|
name: "rdmr",
|
||||||
|
label: "rdmr",
|
||||||
|
location: 69..73,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
location: 69..73,
|
||||||
|
annotation: None,
|
||||||
|
doc: None,
|
||||||
|
is_validator_param: false,
|
||||||
|
},
|
||||||
|
UntypedArg {
|
||||||
|
by: ByName(
|
||||||
|
Named {
|
||||||
|
name: "ctx",
|
||||||
|
label: "ctx",
|
||||||
|
location: 75..78,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
location: 75..78,
|
||||||
|
annotation: None,
|
||||||
|
doc: None,
|
||||||
|
is_validator_param: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
body: Var {
|
||||||
|
location: 86..90,
|
||||||
|
name: "True",
|
||||||
|
},
|
||||||
|
doc: None,
|
||||||
|
location: 68..79,
|
||||||
|
name: "mint",
|
||||||
|
public: true,
|
||||||
|
return_annotation: None,
|
||||||
|
return_type: (),
|
||||||
|
end_position: 93,
|
||||||
|
on_test_failure: FailImmediately,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
location: 0..9,
|
||||||
|
name: "thing",
|
||||||
|
params: [],
|
||||||
|
fallback: Function {
|
||||||
|
arguments: [
|
||||||
|
UntypedArg {
|
||||||
|
by: ByName(
|
||||||
|
Discarded {
|
||||||
|
name: "_",
|
||||||
|
label: "_",
|
||||||
|
location: 104..105,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
location: 104..105,
|
||||||
|
annotation: None,
|
||||||
|
doc: None,
|
||||||
|
is_validator_param: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
body: ErrorTerm {
|
||||||
|
location: 113..117,
|
||||||
|
},
|
||||||
|
doc: None,
|
||||||
|
location: 103..106,
|
||||||
|
name: "temp",
|
||||||
|
public: true,
|
||||||
|
return_annotation: None,
|
||||||
|
return_type: (),
|
||||||
|
end_position: 120,
|
||||||
|
on_test_failure: FailImmediately,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
|
@ -1,22 +1,23 @@
|
||||||
---
|
---
|
||||||
source: crates/aiken-lang/src/parser/definition/validator.rs
|
source: crates/aiken-lang/src/parser/definition/validator.rs
|
||||||
description: "Code:\n\nvalidator {\n fn foo(datum, rdmr, ctx) {\n True\n }\n}\n"
|
description: "Code:\n\nvalidator hello {\n spend (datum, rdmr, ctx) {\n True\n }\n}\n"
|
||||||
---
|
---
|
||||||
Validator(
|
Validator(
|
||||||
Validator {
|
Validator {
|
||||||
doc: None,
|
doc: None,
|
||||||
end_position: 54,
|
end_position: 60,
|
||||||
fun: Function {
|
handlers: [
|
||||||
|
Function {
|
||||||
arguments: [
|
arguments: [
|
||||||
UntypedArg {
|
UntypedArg {
|
||||||
by: ByName(
|
by: ByName(
|
||||||
Named {
|
Named {
|
||||||
name: "datum",
|
name: "datum",
|
||||||
label: "datum",
|
label: "datum",
|
||||||
location: 21..26,
|
location: 27..32,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
location: 21..26,
|
location: 27..32,
|
||||||
annotation: None,
|
annotation: None,
|
||||||
doc: None,
|
doc: None,
|
||||||
is_validator_param: false,
|
is_validator_param: false,
|
||||||
|
@ -26,10 +27,10 @@ Validator(
|
||||||
Named {
|
Named {
|
||||||
name: "rdmr",
|
name: "rdmr",
|
||||||
label: "rdmr",
|
label: "rdmr",
|
||||||
location: 28..32,
|
location: 34..38,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
location: 28..32,
|
location: 34..38,
|
||||||
annotation: None,
|
annotation: None,
|
||||||
doc: None,
|
doc: None,
|
||||||
is_validator_param: false,
|
is_validator_param: false,
|
||||||
|
@ -39,30 +40,59 @@ Validator(
|
||||||
Named {
|
Named {
|
||||||
name: "ctx",
|
name: "ctx",
|
||||||
label: "ctx",
|
label: "ctx",
|
||||||
location: 34..37,
|
location: 40..43,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
location: 34..37,
|
location: 40..43,
|
||||||
annotation: None,
|
annotation: None,
|
||||||
doc: None,
|
doc: None,
|
||||||
is_validator_param: false,
|
is_validator_param: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
body: Var {
|
body: Var {
|
||||||
location: 45..49,
|
location: 51..55,
|
||||||
name: "True",
|
name: "True",
|
||||||
},
|
},
|
||||||
doc: None,
|
doc: None,
|
||||||
location: 14..38,
|
location: 26..44,
|
||||||
name: "foo",
|
name: "spend",
|
||||||
public: false,
|
public: true,
|
||||||
return_annotation: None,
|
return_annotation: None,
|
||||||
return_type: (),
|
return_type: (),
|
||||||
end_position: 52,
|
end_position: 58,
|
||||||
on_test_failure: FailImmediately,
|
on_test_failure: FailImmediately,
|
||||||
},
|
},
|
||||||
other_fun: None,
|
],
|
||||||
location: 0..9,
|
location: 0..9,
|
||||||
|
name: "hello",
|
||||||
params: [],
|
params: [],
|
||||||
|
fallback: Function {
|
||||||
|
arguments: [
|
||||||
|
UntypedArg {
|
||||||
|
by: ByName(
|
||||||
|
Discarded {
|
||||||
|
name: "_ctx",
|
||||||
|
label: "_ctx",
|
||||||
|
location: 0..0,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
location: 0..0,
|
||||||
|
annotation: None,
|
||||||
|
doc: None,
|
||||||
|
is_validator_param: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
body: ErrorTerm {
|
||||||
|
location: 0..0,
|
||||||
|
},
|
||||||
|
doc: None,
|
||||||
|
location: 0..0,
|
||||||
|
name: "fallback",
|
||||||
|
public: true,
|
||||||
|
return_annotation: None,
|
||||||
|
return_type: (),
|
||||||
|
end_position: 60,
|
||||||
|
on_test_failure: FailImmediately,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue