MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / GetScriptResult

Function GetScriptResult

tests/script_parser_test.cpp:13–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12
13BT::Any GetScriptResult(BT::Ast::Environment& environment, const char* text)
14{
15 auto exprs = BT::Scripting::parseStatements(text);
16 if(exprs.empty())
17 {
18 return {};
19 }
20 for(size_t i = 0; i < exprs.size() - 1; ++i)
21 {
22 exprs[i]->evaluate(environment);
23 }
24 return exprs.back()->evaluate(environment);
25}
26
27} // namespace
28

Callers 1

TESTFunction · 0.85

Calls 4

parseStatementsFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected