MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / tonumeral

Function tonumeral

extlibs/lua/src/lcode.c:55–67  ·  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

53** and returns 1. Otherwise, returns 0.
54*/
55static int tonumeral (const expdesc *e, TValue *v) {
56 if (hasjumps(e))
57 return 0; /* not a numeral */
58 switch (e->k) {
59 case VKINT:
60 if (v) setivalue(v, e->u.ival);
61 return 1;
62 case VKFLT:
63 if (v) setfltvalue(v, e->u.nval);
64 return 1;
65 default: return 0;
66 }
67}
68
69
70/*

Callers 5

luaK_exp2constFunction · 0.85
constfoldingFunction · 0.85
codearithFunction · 0.85
codecommutativeFunction · 0.85
luaK_infixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected