compareNodesByOrder static method
Compares two AstNodes by their first position in the query.
Implementation
static int compareNodesByOrder(AstNode first, AstNode second) {
if (first.first == null || second.first == null) {
return 0; // position not set. should we throw in that case?
}
return first.firstPosition.compareTo(second.firstPosition);
}