diff --git a/minijinja/src/compiler/ast.rs b/minijinja/src/compiler/ast.rs index 8f78ce25..38a36c5a 100644 --- a/minijinja/src/compiler/ast.rs +++ b/minijinja/src/compiler/ast.rs @@ -483,8 +483,8 @@ pub struct Call<'a> { pub enum CallArg<'a> { Pos(Expr<'a>), Kwarg(&'a str, Expr<'a>), - Splat(Expr<'a>), - KwargsSplat(Expr<'a>), + PosSplat(Expr<'a>), + KwargSplat(Expr<'a>), } /// Creates a list of values. diff --git a/minijinja/src/compiler/codegen.rs b/minijinja/src/compiler/codegen.rs index 5338507b..df5cfb12 100644 --- a/minijinja/src/compiler/codegen.rs +++ b/minijinja/src/compiler/codegen.rs @@ -763,7 +763,7 @@ impl<'source> CodeGenerator<'source> { self.compile_expr(expr); pending_args += 1; } - ast::CallArg::Splat(expr) => { + ast::CallArg::PosSplat(expr) => { if pending_args > 0 { self.add(Instruction::BuildList(Some(pending_args))); pending_args = 0; @@ -778,7 +778,7 @@ impl<'source> CodeGenerator<'source> { } has_kwargs = true; } - ast::CallArg::KwargsSplat(_) => { + ast::CallArg::KwargSplat(_) => { static_kwargs = false; has_kwargs = true; } @@ -804,7 +804,7 @@ impl<'source> CodeGenerator<'source> { pending_kwargs += 1; } } - ast::CallArg::KwargsSplat(expr) => { + ast::CallArg::KwargSplat(expr) => { if pending_kwargs > 0 { self.add(Instruction::BuildKwargs(pending_kwargs)); num_kwargs_batches += 1; @@ -813,7 +813,7 @@ impl<'source> CodeGenerator<'source> { self.compile_expr(expr); num_kwargs_batches += 1; } - ast::CallArg::Pos(_) | ast::CallArg::Splat(_) => {} + ast::CallArg::Pos(_) | ast::CallArg::PosSplat(_) => {} } } diff --git a/minijinja/src/compiler/meta.rs b/minijinja/src/compiler/meta.rs index e10c6ee0..25661593 100644 --- a/minijinja/src/compiler/meta.rs +++ b/minijinja/src/compiler/meta.rs @@ -85,8 +85,8 @@ fn tracker_visit_callarg<'a>(callarg: &ast::CallArg<'a>, state: &mut AssignmentT match callarg { ast::CallArg::Pos(expr) | ast::CallArg::Kwarg(_, expr) - | ast::CallArg::Splat(expr) - | ast::CallArg::KwargsSplat(expr) => tracker_visit_expr(expr, state), + | ast::CallArg::PosSplat(expr) + | ast::CallArg::KwargSplat(expr) => tracker_visit_expr(expr, state), } } diff --git a/minijinja/src/compiler/parser.rs b/minijinja/src/compiler/parser.rs index efcd055b..7529ac72 100644 --- a/minijinja/src/compiler/parser.rs +++ b/minijinja/src/compiler/parser.rs @@ -602,10 +602,10 @@ impl<'a> Parser<'a> { } } ArgType::Splat => { - args.push(ast::CallArg::Splat(expr)); + args.push(ast::CallArg::PosSplat(expr)); } ArgType::KwargsSplat => { - args.push(ast::CallArg::KwargsSplat(expr)); + args.push(ast::CallArg::KwargSplat(expr)); has_kwargs = true; } }