Check if text occurs at position in document.
text
position
document
bool matches(String text) { return peek(text.length) == text; }