Skip to content

Commit

Permalink
Rename opts to opt_args in Function
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed Mar 19, 2019
1 parent b3a62b4 commit efa5146
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion engine/examples/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn main() {
arg_kind: FunctionArgKind::Field,
val_type: Type::Bytes,
}],
opts: vec![],
opt_args: vec![],
return_type: Type::Bytes,
implementation: FunctionImpl::new(panic_function),
},
Expand Down
4 changes: 2 additions & 2 deletions engine/src/ast/field_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ mod tests {
arg_kind: FunctionArgKind::Field,
val_type: Type::Bytes,
}],
opts: vec![],
opt_args: vec![],
return_type: Type::Bytes,
implementation: FunctionImpl::new(echo_function),
},
Expand All @@ -360,7 +360,7 @@ mod tests {
arg_kind: FunctionArgKind::Field,
val_type: Type::Bytes,
}],
opts: vec![],
opt_args: vec![],
return_type: Type::Bytes,
implementation: FunctionImpl::new(lowercase_function),
},
Expand Down
6 changes: 3 additions & 3 deletions engine/src/ast/function_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<'i, 's> LexWith<'i, &'s Scheme> for FunctionCallExpr<'s> {

let args_len = function.args.len();

let opts_len = function.opts.len();
let opts_len = function.opt_args.len();

for i in 0..args_len {
if i == 0 {
Expand Down Expand Up @@ -155,7 +155,7 @@ impl<'i, 's> LexWith<'i, &'s Scheme> for FunctionCallExpr<'s> {
}

for i in 0..opts_len {
let opt_arg = &function.opts[i];
let opt_arg = &function.opt_args[i];

input = match take(input, 1)? {
(",", mut rest) => {
Expand Down Expand Up @@ -234,7 +234,7 @@ fn test_function() {
arg_kind: FunctionArgKind::Field,
val_type: Type::Bytes,
}],
opts: vec![FunctionOptArg {
opt_args: vec![FunctionOptArg {
arg_kind: FunctionArgKind::Literal,
value: RhsValue::Int(10),
}],
Expand Down
2 changes: 1 addition & 1 deletion engine/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub struct Function {
/// List of mandatory arguments.
pub args: Vec<FunctionArg>,
/// List of optional arguments that can be specified after manatory ones.
pub opts: Vec<FunctionOptArg>,
pub opt_args: Vec<FunctionOptArg>,
/// Function return type.
pub return_type: Type,
/// Actual implementation that will be called at runtime.
Expand Down

0 comments on commit efa5146

Please sign in to comment.