Skip to content

Commit

Permalink
Rename value to default_value in FunctionOptArg
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed Mar 19, 2019
1 parent efa5146 commit fe83998
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions engine/src/ast/function_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
}
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion engine/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fe83998

Please sign in to comment.