summaryrefslogtreecommitdiff
path: root/src/syntax/ast.rs
diff options
context:
space:
mode:
authorMarmare314 <49279081+Marmare314@users.noreply.github.com>2023-04-13 16:07:58 +0200
committerGitHub <noreply@github.com>2023-04-13 16:07:58 +0200
commit0105eb7382801b56781308ea94b3aeffa6fd867f (patch)
tree9374989fb8999f4d1ca1362c8b96679cc61be9e0 /src/syntax/ast.rs
parentd1cd814ef8149cbac6e59c81e074aa59c930eed3 (diff)
Fix function sinks (#638)
Diffstat (limited to 'src/syntax/ast.rs')
-rw-r--r--src/syntax/ast.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 4119802e..e492297a 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -1570,7 +1570,7 @@ pub enum Param {
/// A named parameter with a default value: `draw: false`.
Named(Named),
/// An argument sink: `..args`.
- Sink(Ident),
+ Sink(Option<Ident>),
}
impl AstNode for Param {
@@ -1578,7 +1578,7 @@ impl AstNode for Param {
match node.kind() {
SyntaxKind::Ident => node.cast().map(Self::Pos),
SyntaxKind::Named => node.cast().map(Self::Named),
- SyntaxKind::Spread => node.cast_first_match().map(Self::Sink),
+ SyntaxKind::Spread => Some(Self::Sink(node.cast_first_match())),
_ => Option::None,
}
}
@@ -1587,7 +1587,7 @@ impl AstNode for Param {
match self {
Self::Pos(v) => v.as_untyped(),
Self::Named(v) => v.as_untyped(),
- Self::Sink(v) => v.as_untyped(),
+ Self::Sink(_) => self.as_untyped(),
}
}
}