diff --git a/tatsu/buffering.py b/tatsu/buffering.py
index cba470c..4ab6cf7 100644
--- a/tatsu/buffering.py
+++ b/tatsu/buffering.py
@@ -340,9 +340,7 @@ class Buffer(object):
         if pos is None:
             pos = self._pos
 
-        if pos >= len(self._line_cache):
-            return LineInfo(self.filename, self.linecount, 0, self._len, self._len, '')
-
+        pos = min(pos, len(self._line_cache) - 2)
         start, line, length = self._line_cache[pos]
         end = start + length
         col = pos - start

Error message doesn't contains line on witch error happens
```python
import tatsu

GRAMMAR_TEXT = """
start = ATTRIBUTE operator value ;

ATTRIBUTE = /[A-Za-z]+/;

operator = '='
         | '!='
         ;

value = NUMBER ;

NUMBER = /[0-9]+/ ;
"""


def parse(data):
    with open('gr.py', 'w') as fd:
        fd.write(tatsu.to_python_sourcecode(GRAMMAR_TEXT))
    grammar = tatsu.compile(GRAMMAR_TEXT)
    return grammar.parse(data)


for sample in ['foo = 1', 'foo']:
    print(sample)
    print(parse(sample))

```

```
python t.py
foo = 1
['foo', '=', '1']
foo
Traceback (most recent call last):
  File "t.py", line 27, in <module>
    print(parse(sample))
  File "t.py", line 22, in parse
    return grammar.parse(data)
  File "/Users/wizard/Code/TatSu/tatsu/grammars.py", line 946, in parse
    **kwargs
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 211, in parse
    raise self._furthest_exception
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 203, in parse
    result = rule()
  File "/Users/wizard/Code/TatSu/tatsu/grammars.py", line 694, in parse
    result = self._parse_rhs(ctx, self.exp)
  File "/Users/wizard/Code/TatSu/tatsu/grammars.py", line 701, in _parse_rhs
    result = ctx._call(ruleinfo)
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 509, in _call
    result = self._recursive_call(ruleinfo)
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 540, in _recursive_call
    result = self._invoke_rule(ruleinfo, key)
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 573, in _invoke_rule
    ruleinfo.impl(self)
  File "/Users/wizard/Code/TatSu/tatsu/grammars.py", line 349, in parse
    ctx.last_node = [s.parse(ctx) for s in self.sequence]
  File "/Users/wizard/Code/TatSu/tatsu/grammars.py", line 349, in <listcomp>
    ctx.last_node = [s.parse(ctx) for s in self.sequence]
  File "/Users/wizard/Code/TatSu/tatsu/grammars.py", line 650, in parse
    return rule()
  File "/Users/wizard/Code/TatSu/tatsu/grammars.py", line 694, in parse
    result = self._parse_rhs(ctx, self.exp)
  File "/Users/wizard/Code/TatSu/tatsu/grammars.py", line 701, in _parse_rhs
    result = ctx._call(ruleinfo)
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 509, in _call
    result = self._recursive_call(ruleinfo)
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 540, in _recursive_call
    result = self._invoke_rule(ruleinfo, key)
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 573, in _invoke_rule
    ruleinfo.impl(self)
  File "/Users/wizard/Code/TatSu/tatsu/grammars.py", line 401, in parse
    ctx._error('no available options')
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 435, in _error
    raise self._make_exception(item, exclass=exclass)
tatsu.exceptions.FailedParse: (1:1) no available options :

^
operator
start
```

Expected something like
```
  File "/Users/wizard/Code/TatSu/tatsu/contexts.py", line 435, in _error
    raise self._make_exception(item, exclass=exclass)
tatsu.exceptions.FailedParse: (1:1) no available options :
foo
^
operator
start
```

diff --git a/test/buffering_test.py b/test/buffering_test.py
index e9d00d2..802ccf9 100644
--- a/test/buffering_test.py
+++ b/test/buffering_test.py
@@ -81,8 +81,8 @@ class BufferingTests(unittest.TestCase):
                 start = n + 1
         text_len = len(self.text)
         info = self.buf.line_info(1 + text_len)
-        self.assertEqual(info.line, 1 + len(self.text.splitlines()))
-        self.assertEqual(info.start, text_len)
+        self.assertEqual(info.line, len(self.text.splitlines()) - 1)
+        self.assertEqual(info.end, text_len)
 
     def test_linecount(self):
         b = Buffer('')

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-flake8 pytest-mypy pytest-pylint
3.9
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
astroid==3.3.9
dill==0.3.9
exceptiongroup==1.2.2
filelock==3.18.0
flake8==7.2.0
iniconfig==2.1.0
isort==6.0.1
mccabe==0.7.0
mypy==1.15.0
mypy-extensions==1.0.0
packaging==24.2
platformdirs==4.3.7
pluggy==1.5.0
pycodestyle==2.13.0
pyflakes==3.3.1
pylint==3.3.6
pytest==8.3.5
pytest-flake8==1.3.0
pytest-mypy==1.0.0
pytest-pylint==0.21.0
-e git+https://github.com/neogeny/TatSu.git@5861760d7e0fb5bdd7d9639faac8a512dacc4c41#egg=TatSu
tomli==2.2.1
tomlkit==0.13.2
typing_extensions==4.13.0

name: TatSu
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - astroid==3.3.9
      - dill==0.3.9
      - exceptiongroup==1.2.2
      - filelock==3.18.0
      - flake8==7.2.0
      - iniconfig==2.1.0
      - isort==6.0.1
      - mccabe==0.7.0
      - mypy==1.15.0
      - mypy-extensions==1.0.0
      - packaging==24.2
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.1
      - pylint==3.3.6
      - pytest==8.3.5
      - pytest-flake8==1.3.0
      - pytest-mypy==1.0.0
      - pytest-pylint==0.21.0
      - tomli==2.2.1
      - tomlkit==0.13.2
      - typing-extensions==4.13.0
prefix: /opt/conda/envs/TatSu

test/buffering_test.py::BufferingTests::test_line_info_consistency
test/buffering_test.py::BufferingTests::test_goto_consistency test/buffering_test.py::BufferingTests::test_line_consistency test/buffering_test.py::BufferingTests::test_linecount test/buffering_test.py::BufferingTests::test_next_consisntency test/buffering_test.py::BufferingTests::test_pos_consistency
tatsu/buffering.py
tatsu/buffering.py