MCPcopy Create free account
hub / github.com/covscript/covscript / parse_dec

Method parse_dec

sources/instance/runtime.cpp:354–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352 }
353
354 var runtime_type::parse_dec(const var &a, const var &b)
355 {
356 if (a.usable()) {
357 if (b.usable())
358 throw runtime_error("Unsupported operator operations(Dec).");
359 else if (a.is_type_of<numeric>())
360 return a.val<numeric>()--;
361 else {
362 var oldt = copy(a);
363 --a;
364 return oldt;
365 }
366 }
367 else {
368 if (!b.usable())
369 throw runtime_error("Unsupported operator operations(Dec).");
370 else
371 return --b;
372 }
373 }
374
375 var runtime_type::parse_addr(const var &b)
376 {

Callers

nothing calls this directly

Calls 3

runtime_errorClass · 0.85
copyFunction · 0.50
usableMethod · 0.45

Tested by

no test coverage detected