Make resolver filename aware

This allows a resolver to take the filename of the currently processed file into account.
can you elaborate on reason for checking the length ?