MCPcopy Create free account
hub / github.com/aardappel/treesheets / RefToString

Function RefToString

lobster/src/vmdata.cpp:190–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void RefToString(VM &vm, ostringstream &ss, const RefObj *ro, PrintPrefs &pp) {
191 if (!ro) { ss << "nil"; return; }
192 auto &roti = ro->ti(vm);
193 switch (roti.t) {
194 case V_STRING: ((LString *)ro)->ToString(ss, pp); break;
195 case V_COROUTINE: ss << "(coroutine)"; break;
196 case V_VECTOR: ((LVector *)ro)->ToString(vm, ss, pp); break;
197 case V_CLASS: ((LObject *)ro)->ToString(vm, ss, pp); break;
198 case V_RESOURCE: ((LResource *)ro)->ToString(ss); break;
199 default: ss << '(' << BaseTypeName(roti.t) << ')'; break;
200 }
201}
202
203void Value::ToString(VM &vm, ostringstream &ss, const TypeInfo &ti, PrintPrefs &pp) const {
204 if (ti.t == V_INT && ti.enumidx >= 0) {

Callers 5

DumpValMethod · 0.85
DumpLeaksMethod · 0.85
ErrorMethod · 0.85
AddBuiltinsFunction · 0.85
ToStringBaseMethod · 0.85

Calls 2

BaseTypeNameFunction · 0.85
ToStringMethod · 0.45

Tested by

no test coverage detected