| 183 | } |
| 184 | |
| 185 | AR_ExpNode *AR_EXP_NewOpNode |
| 186 | ( |
| 187 | const char *func_name, |
| 188 | bool include_internal, |
| 189 | uint child_count |
| 190 | ) { |
| 191 | // retrieve function |
| 192 | AR_FuncDesc *func = AR_GetFunc(func_name, include_internal); |
| 193 | AR_ExpNode *node = _AR_EXP_NewOpNode(child_count); |
| 194 | |
| 195 | if(!func->internal) _AR_EXP_ValidateArgsCount(func, child_count); |
| 196 | |
| 197 | ASSERT(func != NULL); |
| 198 | node->op.f = func; |
| 199 | |
| 200 | // add aggregation context as function private data |
| 201 | if(func->aggregate) { |
| 202 | // generate aggregation context and store it in node's private data |
| 203 | ASSERT(func->callbacks.private_data != NULL); |
| 204 | node->op.private_data = func->callbacks.private_data(); |
| 205 | } |
| 206 | |
| 207 | return node; |
| 208 | } |
| 209 | |
| 210 | static inline AR_ExpNode *_AR_EXP_InitializeOperand(AR_OperandNodeType type) { |
| 211 | AR_ExpNode *node = rm_calloc(1, sizeof(AR_ExpNode)); |
no test coverage detected