positionString static method
Returns a human readable string representing the position index in a
buffer.
const buffer = 'a\nb';
print(Token.positionString(buffer, 0)); // 1:1
print(Token.positionString(buffer, 2)); // 2:1
Implementation
static String positionString(String buffer, int position) {
final lineAndColumn = lineAndColumnOf(buffer, position);
return '${lineAndColumn[0]}:${lineAndColumn[1]}';
}