(&self, scope: Scope<'_>)
| 51 | } |
| 52 | |
| 53 | fn exec(&self, scope: Scope<'_>) -> CallResult<()> { |
| 54 | let mut total = 0.0; |
| 55 | let mut reg = 0; |
| 56 | loop { |
| 57 | let sep = match scope.get_type(reg) { |
| 58 | VarArgTag::Immediate(sep, etype) => { |
| 59 | reg += 1; |
| 60 | match etype { |
| 61 | ExprType::Double => total += scope.get_double(reg), |
| 62 | ExprType::Integer => total += f64::from(scope.get_integer(reg)), |
| 63 | _ => { |
| 64 | return Err(CallError::Argument( |
| 65 | "Only accepts numerical values".to_owned(), |
| 66 | )); |
| 67 | } |
| 68 | } |
| 69 | sep |
| 70 | } |
| 71 | |
| 72 | _ => { |
| 73 | return Err(CallError::Argument("Only accepts numerical values".to_owned())); |
| 74 | } |
| 75 | }; |
| 76 | reg += 1; |
| 77 | |
| 78 | if sep == ArgSep::End { |
| 79 | break; |
| 80 | } |
| 81 | } |
| 82 | scope.return_double(total) |
| 83 | } |
| 84 | } |
nothing calls this directly
no test coverage detected