stsewd / tree-sitter-rst

reStructuredText grammar for tree-sitter
https://stsewd.dev/tree-sitter-rst/
MIT License
50 stars 7 forks source link

Misparsing of paragraph #31

Closed Carreau closed 1 year ago

Carreau commented 2 years ago
Data in new :class:`ndarrays <ndarray>` is in the :term:`row-major`
(C) order, unless otherwise specified, but, for example, :ref:`basic
array slicing <arrays.indexing>` often produces :term:`views <view>`
in a different scheme.

Seem to be seen as a section title plus stuff. It looks like it's due to the (C) on the second lne.

Carreau commented 2 years ago

Second similar example:

Notice that (i) we force interpolation by using `s=0`,
(ii) the parameterization, ``u``, is generated automatically.
Now plot the result:
Carreau commented 2 years ago

I tracked this down in particular to parse_overline. This is strange as it happens only when the (x) is on the second line of the paragraph.

I'm slightly confused as to why that is, I'm sure there are reason, but why is parse_overline not returning false if the full line is not made of the same adornment character without advancing the lexer.