Allow parameters inside of a task to be optional.

I can imagine a few cases where there wouldn't be any parameters needed
This commit is contained in:
R Tyler Croy 2020-12-30 14:40:52 -08:00
parent 904bf007ce
commit b00e9835e8
2 changed files with 13 additions and 3 deletions

View File

@ -26,8 +26,18 @@ mod tests {
script {
inline = "zypper in -y ${ZAP_PACKAGE}"
}
}
"#;
}"#;
let _task = TaskParser::parse(Rule::task, buf)
.unwrap().next().unwrap();
}
#[test]
fn parse_no_parameters() {
let buf = r#"task PrintEnv {
script {
inline = "env"
}
}"#;
let _task = TaskParser::parse(Rule::task, buf)
.unwrap().next().unwrap();
}

View File

@ -7,7 +7,7 @@ taskfile = _{ SOI
task = { "task"
~ identifier
~ opening_brace
~ parameters
~ parameters?
~ script
~ closing_brace
}