tree-sitter/spec/runtime/helpers/tree_helpers.cc

9 lines
258 B
C++
Raw Normal View History

2014-06-23 18:50:03 -07:00
#include "runtime/helpers/tree_helpers.h"
2014-06-28 18:45:22 -07:00
TSTree ** tree_array(std::vector<TSTree *> trees) {
2014-08-06 13:00:35 -07:00
TSTree ** result = (TSTree **)calloc(trees.size(), sizeof(TSTree *));
for (size_t i = 0; i < trees.size(); i++)
result[i] = trees[i];
return result;
}