Describe the bug
The following code block causes a C-language "lexing error" to be reported and highlighting skipped.
.. code-block :: c
int div(int x, int y)
//@requires y >= 0;
{
return x / y;
}
On the other hand, if I just remove the trailing semicolon on the comment line, the error goes away. i.e. the below version lexes fine.
.. code-block :: c
int div(int x, int y)
//@requires y >= 0
{
return x / y;
}
.. and the following lexes fine too -
.. code-block :: c
int div(int x, int y)
// requires y >= 0;
{
return x / y;
}
Since the line in question is a comment line, what characters feature within the comment line should not be of any consequence for lexing the block as "C".
How to Reproduce
Include the example code blocks shown in any rat documentation processed by Sphinx.
Expected behavior
All the indicated C-language code blocks should lex fine since the line in question is a comment line.
Your project
not required as examples given in doc
Screenshots
No response
OS
MacOS
Python version
3.8.8
Sphinx version
4.0.1
Sphinx extensions
none
Extra tools
none
Additional context
Tested using project created by sphinx-quickstart
Describe the bug
The following code block causes a C-language "lexing error" to be reported and highlighting skipped.
On the other hand, if I just remove the trailing semicolon on the comment line, the error goes away. i.e. the below version lexes fine.
.. and the following lexes fine too -
Since the line in question is a comment line, what characters feature within the comment line should not be of any consequence for lexing the block as "C".
How to Reproduce
Include the example code blocks shown in any rat documentation processed by Sphinx.
Expected behavior
All the indicated C-language code blocks should lex fine since the line in question is a comment line.
Your project
not required as examples given in doc
Screenshots
No response
OS
MacOS
Python version
3.8.8
Sphinx version
4.0.1
Sphinx extensions
none
Extra tools
none
Additional context
Tested using project created by sphinx-quickstart