[PATCH] D80145: [docs] Enable syntax highlight of MIR (requires pygments 2.6.1)

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 10:48:14 PDT 2020


dsanders created this revision.
Herald added a project: LLVM.

pygments 2.6.1 contains support for MIR syntax highlighting.
It's been a couple months since that was released so I'd like
to suggest enabling it in our docs. There are two lexers
available, llvm-mir is for full MIR examples, and
llvm-mir-body is for examples of the body section without the
usual YAML wrapper.

It looks like I missed a few things in the pygments lexer as
some of these MIR examples don't highlight. Some like 'BUNDLE'
I intentionally didn't cover in the first attempt but it seems
I missed some keywords too (e.g. implicit-def, frame-setup,
frame-destroy), some LLVM-IR variable characters, and <regmask...>
Unfortunately, sphinx doesn't warn when pygments emits an
Error token (it silently drops all highlighting) so there may be more.

A few subsections in MIR are also not highlighted but they
don't cause unrelated highlights to disappear. E.g. the constants
section.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80145

Files:
  llvm/docs/GlobalISel/GenericOpcode.rst
  llvm/docs/GlobalISel/IRTranslator.rst
  llvm/docs/GlobalISel/KnownBits.rst
  llvm/docs/MIRLangRef.rst

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80145.264681.patch
Type: text/x-patch
Size: 13644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200518/ae6b1a77/attachment.bin>


More information about the llvm-commits mailing list