summaryrefslogtreecommitdiff
path: root/src/parse/collection.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-03 00:12:09 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-03 00:12:09 +0100
commitaae67bd572ad86f4c57e364daa51a9dc883b8913 (patch)
tree0aba021e0748ebad2197ea390385ec5f93ccbc6e /src/parse/collection.rs
parent1c40dc42e7bc7b799b77f06d25414aca59a044ba (diff)
Move and rename many things 🚛
Diffstat (limited to 'src/parse/collection.rs')
-rw-r--r--src/parse/collection.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/parse/collection.rs b/src/parse/collection.rs
index db267dbe..889cfb0f 100644
--- a/src/parse/collection.rs
+++ b/src/parse/collection.rs
@@ -2,7 +2,7 @@ use super::*;
use crate::diag::Deco;
/// Parse the arguments to a function call.
-pub fn arguments(p: &mut Parser) -> Arguments {
+pub fn arguments(p: &mut Parser) -> ExprArgs {
collection(p, vec![])
}
@@ -74,7 +74,7 @@ trait Collection {
fn push_comma(&mut self) {}
}
-impl Collection for Arguments {
+impl Collection for ExprArgs {
fn push_arg(&mut self, _: &mut Parser, arg: Spanned<Argument>) {
self.push(arg.v);
}
@@ -85,17 +85,17 @@ impl Collection for Arguments {
enum State {
Unknown,
Expr(Spanned<Expr>),
- Array(Array),
- Dict(Dict),
+ Array(ExprArray),
+ Dict(ExprDict),
}
impl State {
fn into_expr(self) -> Expr {
match self {
- Self::Unknown => Expr::Lit(Lit::Array(vec![])),
+ Self::Unknown => Expr::Array(vec![]),
Self::Expr(expr) => expr.v,
- Self::Array(array) => Expr::Lit(Lit::Array(array)),
- Self::Dict(dict) => Expr::Lit(Lit::Dict(dict)),
+ Self::Array(array) => Expr::Array(array),
+ Self::Dict(dict) => Expr::Dict(dict),
}
}
}