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

Method parse_inc

sources/instance/runtime.cpp:333–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331 }
332
333 var runtime_type::parse_inc(const var &a, const var &b)
334 {
335 if (a.usable()) {
336 if (b.usable())
337 throw runtime_error("Unsupported operator operations(Inc).");
338 else if (a.is_type_of<numeric>())
339 return a.val<numeric>()++;
340 else {
341 var oldt = copy(a);
342 ++a;
343 return oldt;
344 }
345 }
346 else {
347 if (!b.usable())
348 throw runtime_error("Unsupported operator operations(Inc).");
349 else
350 return ++b;
351 }
352 }
353
354 var runtime_type::parse_dec(const var &a, const var &b)
355 {

Callers

nothing calls this directly

Calls 3

runtime_errorClass · 0.85
copyFunction · 0.50
usableMethod · 0.45

Tested by

no test coverage detected