Allow rest vars to have a custom name

This commit is contained in:
JT
2021-09-07 15:37:02 +12:00
parent 8f54ba10aa
commit bdce34676a
7 changed files with 77 additions and 16 deletions

View File

@ -108,9 +108,14 @@ impl Signature {
self
}
pub fn rest(mut self, shape: impl Into<SyntaxShape>, desc: impl Into<String>) -> Signature {
pub fn rest(
mut self,
name: &str,
shape: impl Into<SyntaxShape>,
desc: impl Into<String>,
) -> Signature {
self.rest_positional = Some(PositionalArg {
name: "rest".into(),
name: name.into(),
desc: desc.into(),
shape: shape.into(),
var_id: None,