I have never used lazy_list_location//1 so I can’t directly answer to that, but have used phrase_from_file//2 which was not keeping track of the line and position and as I noted in the other topic referenced below, my solution was to just thread counters through the DCG. If you find yourself adding many variables to DCG, then have a look at package edcgs.
A related question of interest: Line_count/2 and phrase_from_file