function getPathToRoot(node) {
	const path = [];
	let current = node;

	do {
		path.push(current);
		current = current.parent;
	} while (current);

	return path;
}
Finds the path from the given `regexpp` AST node to the root node.
@param {regexpp.Node} node Node.
@returns {regexpp.Node[]} Array that starts with the given node and ends with the root node.