MCPcopy Create free account
hub / github.com/MikePopoloski/slang / eval

Method eval

source/ast/builtins/StringMethods.cpp:89–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 upper(upper) {}
88
89 ConstantValue eval(EvalContext& context, const Args& args, SourceRange,
90 const CallExpression::SystemCallInfo&) const final {
91 auto val = args[0]->eval(context);
92 if (!val)
93 return nullptr;
94
95 std::string& str = val.str();
96 if (upper)
97 strToUpper(str);
98 else
99 strToLower(str);
100 return val;
101 }
102
103private:
104 bool upper;

Callers

nothing calls this directly

Calls 4

strToUpperFunction · 0.85
strToLowerFunction · 0.85
strMethod · 0.80
evalMethod · 0.45

Tested by

no test coverage detected