feat: new check for valid purpose names
This commit is contained in:
@@ -54,7 +54,7 @@ Validator(
|
||||
name: "True",
|
||||
},
|
||||
doc: None,
|
||||
location: 26..44,
|
||||
location: 20..44,
|
||||
name: "spend",
|
||||
public: true,
|
||||
return_annotation: None,
|
||||
@@ -96,7 +96,7 @@ Validator(
|
||||
name: "True",
|
||||
},
|
||||
doc: None,
|
||||
location: 68..79,
|
||||
location: 63..79,
|
||||
name: "mint",
|
||||
public: true,
|
||||
return_annotation: None,
|
||||
|
||||
@@ -54,7 +54,7 @@ Validator(
|
||||
name: "True",
|
||||
},
|
||||
doc: None,
|
||||
location: 26..44,
|
||||
location: 20..44,
|
||||
name: "spend",
|
||||
public: true,
|
||||
return_annotation: None,
|
||||
@@ -96,7 +96,7 @@ Validator(
|
||||
name: "True",
|
||||
},
|
||||
doc: None,
|
||||
location: 68..79,
|
||||
location: 63..79,
|
||||
name: "mint",
|
||||
public: true,
|
||||
return_annotation: None,
|
||||
|
||||
@@ -54,7 +54,7 @@ Validator(
|
||||
name: "True",
|
||||
},
|
||||
doc: None,
|
||||
location: 26..44,
|
||||
location: 20..44,
|
||||
name: "spend",
|
||||
public: true,
|
||||
return_annotation: None,
|
||||
|
||||
@@ -23,16 +23,18 @@ pub fn parser() -> impl Parser<Token, ast::UntypedDefinition, Error = ParseError
|
||||
.then(
|
||||
select! {Token::Name {name} => name}
|
||||
.then(args_and_body())
|
||||
.map(|(name, mut function)| {
|
||||
.map_with_span(|(name, mut function), span| {
|
||||
function.name = name;
|
||||
function.location.start = span.start;
|
||||
|
||||
function
|
||||
})
|
||||
.repeated()
|
||||
.then(
|
||||
just(Token::Else)
|
||||
.ignore_then(args_and_body().map(|mut function| {
|
||||
.ignore_then(args_and_body().map_with_span(|mut function, span| {
|
||||
function.name = "else".to_string();
|
||||
function.location.start = span.start;
|
||||
|
||||
function
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user