MCPcopy Create free account
hub / github.com/DFHack/dfhack / tonumeral

Function tonumeral

depends/lua/src/lcode.c:43–55  ·  view source on GitHub ↗

** If expression is a numeric constant, fills 'v' with its value ** and returns 1. Otherwise, returns 0. */

Source from the content-addressed store, hash-verified

41** and returns 1. Otherwise, returns 0.
42*/
43static int tonumeral(const expdesc *e, TValue *v) {
44 if (hasjumps(e))
45 return 0; /* not a numeral */
46 switch (e->k) {
47 case VKINT:
48 if (v) setivalue(v, e->u.ival);
49 return 1;
50 case VKFLT:
51 if (v) setfltvalue(v, e->u.nval);
52 return 1;
53 default: return 0;
54 }
55}
56
57
58/*

Callers 2

constfoldingFunction · 0.85
luaK_infixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected