Skip to content

Commit e35cc81

Browse files
committed
Rename to Unnamed and Named
1 parent b7916cd commit e35cc81

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

parser/src/ast.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ pub enum StringGroup {
395395
#[derive(Debug, PartialEq)]
396396
pub enum Varargs {
397397
None,
398-
NoCapture,
399-
Capture(Parameter),
398+
Unnamed,
399+
Named(Parameter),
400400
}
401401

402402
impl Default for Varargs {
@@ -409,8 +409,8 @@ impl From<Option<Option<Parameter>>> for Varargs {
409409
fn from(opt: Option<Option<Parameter>>) -> Varargs {
410410
match opt {
411411
Some(inner_opt) => match inner_opt {
412-
Some(param) => Varargs::Capture(param),
413-
None => Varargs::NoCapture,
412+
Some(param) => Varargs::Named(param),
413+
None => Varargs::Unnamed,
414414
},
415415
None => Varargs::None,
416416
}

vm/src/bytecode.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ pub enum UnaryOperator {
240240
#[derive(Debug, Clone, PartialEq)]
241241
pub enum Varargs {
242242
None,
243-
NoCapture,
244-
Capture(String),
243+
Unnamed,
244+
Named(String),
245245
}
246246

247247
/*
@@ -413,8 +413,8 @@ impl From<ast::Varargs> for Varargs {
413413
fn from(varargs: ast::Varargs) -> Varargs {
414414
match varargs {
415415
ast::Varargs::None => Varargs::None,
416-
ast::Varargs::NoCapture => Varargs::NoCapture,
417-
ast::Varargs::Capture(param) => Varargs::Capture(param.arg),
416+
ast::Varargs::Unnamed => Varargs::Unnamed,
417+
ast::Varargs::Named(param) => Varargs::Named(param.arg),
418418
}
419419
}
420420
}
@@ -423,8 +423,8 @@ impl<'a> From<&'a ast::Varargs> for Varargs {
423423
fn from(varargs: &'a ast::Varargs) -> Varargs {
424424
match varargs {
425425
ast::Varargs::None => Varargs::None,
426-
ast::Varargs::NoCapture => Varargs::NoCapture,
427-
ast::Varargs::Capture(ref param) => Varargs::Capture(param.arg.clone()),
426+
ast::Varargs::Unnamed => Varargs::Unnamed,
427+
ast::Varargs::Named(ref param) => Varargs::Named(param.arg.clone()),
428428
}
429429
}
430430
}

vm/src/vm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ impl VirtualMachine {
402402

403403
// Pack other positional arguments in to *args:
404404
match code_object.varargs {
405-
bytecode::Varargs::Capture(ref vararg_name) => {
405+
bytecode::Varargs::Named(ref vararg_name) => {
406406
let mut last_args = vec![];
407407
for i in n..nargs {
408408
let arg = &args.args[i];
@@ -412,7 +412,7 @@ impl VirtualMachine {
412412

413413
locals.set_item(&self.ctx, vararg_name, vararg_value);
414414
}
415-
bytecode::Varargs::NoCapture => {
415+
bytecode::Varargs::Unnamed => {
416416
// just ignore the rest of the args
417417
}
418418
bytecode::Varargs::None => {
@@ -428,12 +428,12 @@ impl VirtualMachine {
428428

429429
// Do we support `**kwargs` ?
430430
let kwargs = match code_object.varkeywords {
431-
bytecode::Varargs::Capture(ref kwargs_name) => {
431+
bytecode::Varargs::Named(ref kwargs_name) => {
432432
let d = self.new_dict();
433433
locals.set_item(&self.ctx, kwargs_name, d.clone());
434434
Some(d)
435435
}
436-
bytecode::Varargs::NoCapture => Some(self.new_dict()),
436+
bytecode::Varargs::Unnamed => Some(self.new_dict()),
437437
bytecode::Varargs::None => None,
438438
};
439439

0 commit comments

Comments
 (0)