add file to lexer lookup only if we actually parse it (closes #3188)