Isn't possible to 'push back' a linefeed after an end is found?
Ie the end-table-handler prepends a linefeed
returns a pushback string to the Lexer?
Well as far as I understand the lexer builds some "match-all-at-once" regexp to parse the text so this could be harder than it sounds. But maybe it could be done with a lookahead regexp. I'm not familar enough with the inner workings of the lexer yet so I'm not sure how to solve this...