From fe839981ccf213fe1c5088c329b9d23d0f91ccee Mon Sep 17 00:00:00 2001 From: Elie ROUDNINSKI Date: Fri, 15 Mar 2019 00:27:27 +0000 Subject: [PATCH] Rename value to default_value in FunctionOptArg --- engine/src/ast/function_expr.rs | 6 +++--- engine/src/functions.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/ast/function_expr.rs b/engine/src/ast/function_expr.rs index 951a6b9a..3528e920 100644 --- a/engine/src/ast/function_expr.rs +++ b/engine/src/ast/function_expr.rs @@ -161,7 +161,7 @@ impl<'i, 's> LexWith<'i, &'s Scheme> for FunctionCallExpr<'s> { (",", mut rest) => { let arg_def = FunctionArg { arg_kind: opt_arg.arg_kind.clone(), - val_type: opt_arg.value.get_type(), + val_type: opt_arg.default_value.get_type(), }; rest = skip_space(rest); @@ -184,7 +184,7 @@ impl<'i, 's> LexWith<'i, &'s Scheme> for FunctionCallExpr<'s> { _ => { function_call .args - .push(FunctionCallArgExpr::Literal(opt_arg.value.clone())); + .push(FunctionCallArgExpr::Literal(opt_arg.default_value.clone())); input } @@ -236,7 +236,7 @@ fn test_function() { }], opt_args: vec![FunctionOptArg { arg_kind: FunctionArgKind::Literal, - value: RhsValue::Int(10), + default_value: RhsValue::Int(10), }], return_type: Type::Bytes, implementation: FunctionImpl::new(echo_function), diff --git a/engine/src/functions.rs b/engine/src/functions.rs index 28d73a1a..322d4528 100644 --- a/engine/src/functions.rs +++ b/engine/src/functions.rs @@ -58,7 +58,7 @@ pub struct FunctionOptArg { /// How the argument can be specified when calling a function. pub arg_kind: FunctionArgKind, /// The default value if the argument is missing. - pub value: RhsValue, + pub default_value: RhsValue, } /// Defines a function.