MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / tonumeral

Function tonumeral

third-party/lua-5.5.0/src/lcode.c:57–69  ·  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

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

Callers 5

luaK_exp2constFunction · 0.70
constfoldingFunction · 0.70
codearithFunction · 0.70
codecommutativeFunction · 0.70
luaK_infixFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected