MCPcopy Create free account
hub / github.com/ZDoom/Raze / PrintExprConstant

Function PrintExprConstant

source/common/scripting/frontend/ast.cpp:603–629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601}
602
603static void PrintExprConstant(FLispString &out, const ZCC_TreeNode *node)
604{
605 ZCC_ExprConstant *enode = (ZCC_ExprConstant *)node;
606 assert(enode->Operation == PEX_ConstValue);
607 out.Open("expr-const");
608 if (enode->Type == TypeString)
609 {
610 PrintStringConst(out, *enode->StringVal);
611 }
612 else if (enode->Type == TypeFloat64)
613 {
614 out.AddFloat(enode->DoubleVal, false);
615 }
616 else if (enode->Type == TypeFloat32)
617 {
618 out.AddFloat(enode->DoubleVal, true);
619 }
620 else if (enode->Type == TypeName)
621 {
622 out.AddName(ENamedName(enode->IntVal));
623 }
624 else if (enode->Type->isIntCompatible())
625 {
626 out.AddInt(enode->IntVal, static_cast<PInt *>(enode->Type)->Unsigned);
627 }
628 out.Close();
629}
630
631static void PrintExprFuncCall(FLispString &out, const ZCC_TreeNode *node)
632{

Callers

nothing calls this directly

Calls 7

PrintStringConstFunction · 0.85
AddFloatMethod · 0.80
isIntCompatibleMethod · 0.80
AddIntMethod · 0.80
OpenMethod · 0.45
AddNameMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected