[llvm-commits] [PATCH] Convert SourceLevelDebugging.html to reST

Sean Silva silvas at purdue.edu
Wed Nov 21 18:00:13 PST 2012


> The code block is marked as '.. code-block:: llvm', but this line:
>
>> Function * , ;; Pointer to LLVM function
>
> seems to confuse the highlighter.  If I remove it, highlighting works.
>  (But obviously, removing the line is not an option.)  There are
> similar issues in other places.

This is a problem that I have encountered with Sphinx as well.
Basically, it bails out if the input doesn't match what the "lexer"
expects. I believe the root cause of this is that the "lexer"s in the
Pygments library (which Sphinx uses to highlight) does not seem to
handle errors well (for reference, the code for the LLVM asm lexer is
at <https://bitbucket.org/birkenfeld/pygments-main/src/24c16194941a7464a0cbe27896cc103b9bbab6a9/pygments/lexers/asm.py?at=default#cl-193>).

>> * In the original HTML, LLVMDebugVersion in the metadata listings was
>> linking to a paragraph explaining it. This is probably not very
>> important, but nice to have. Is there a simple way to reproduce this
>> effect in the ReST doc?
>
> Unfortunately, I don't think it is possible.  Maybe Sean could give an advice?

It's not possible. reST does not handle nesting well.


The patch LGTM. Please commit. Since this document has serious flaws
in its content (out of date or otherwise incorrect), it's not worth
spending time putting lipstick on it.

-- Sean Silva

On Wed, Nov 21, 2012 at 4:03 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Wed, Nov 21, 2012 at 10:56 PM, Eli Bendersky <eliben at google.com> wrote:
>> Some comments:
>
> Thanks for reviewing!
>
>> * In the "subprogram descriptors" section, the code is not
>> highlighted. Also in other places. Not sure how important highlighting
>> is here, but it would be nice to make it consistent
>
> The code block is marked as '.. code-block:: llvm', but this line:
>
>> Function * , ;; Pointer to LLVM function
>
> seems to confuse the highlighter.  If I remove it, highlighting works.
>  (But obviously, removing the line is not an option.)  There are
> similar issues in other places.
>
>> * In the original HTML, LLVMDebugVersion in the metadata listings was
>> linking to a paragraph explaining it. This is probably not very
>> important, but nice to have. Is there a simple way to reproduce this
>> effect in the ReST doc?
>
> Unfortunately, I don't think it is possible.  Maybe Sean could give an advice?
>
>> * When the HTML version mensions the intrinsics (i.e.
>> llvm.dbg.declare), they are links. Not in ReST
>
> Same here -- as far as I know, it is not possible to have a link in
> fixed width font...
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the llvm-commits mailing list