| 64 | } |
| 65 | |
| 66 | struct Value* ScriptArgs::at(int i) const |
| 67 | { |
| 68 | // picoc rejects a call with too few arguments before it ever reaches an |
| 69 | // intrinsic, so this only fires when a binding reads past its own |
| 70 | // prototype in library_checkpoint.c. |
| 71 | if (mParam == nullptr || i < 0 || i >= mNumArgs) { |
| 72 | fail("argument %d is missing (%d passed)", i + 1, mNumArgs); |
| 73 | } |
| 74 | struct Value* value = mParam[i]; |
| 75 | if (value == nullptr || value->Val == nullptr) { |
| 76 | fail("argument %d has no value", i + 1); |
| 77 | } |
| 78 | return value; |
| 79 | } |
| 80 | |
| 81 | int ScriptArgs::intAt(int i) const |
| 82 | { |
no outgoing calls
no test coverage detected