summaryrefslogtreecommitdiff
path: root/pygments/lexers/_mapping.py
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2020-01-24 08:56:46 -0800
committerMatthäus G. Chajdas <Anteru@users.noreply.github.com>2020-01-24 17:56:46 +0100
commit59396bb83c3a1ba6331fa65771ce3d881e9f7c0c (patch)
tree739fc2dc3d42a2b939d08a458ffea2314bc751ea /pygments/lexers/_mapping.py
parentc786e452f08840d4cc5ac8b3fcb001a218b7a56b (diff)
downloadpygments-git-59396bb83c3a1ba6331fa65771ce3d881e9f7c0c.tar.gz
Add lexer for LLVM's MIR format (#1361)
MIR is a human readable serialization format that's used to represent LLVM's machine specific intermediate representation. It allows LLVM's developers to see the state of the compilation process at various points, as well as test individual pieces of the compiler. Our documentation for the format can be found at https://llvm.org/docs/MIRLangRef.html. Adding a lexer for this format will allow the LLVM documentation to contain syntax highlighted examples of LLVM-MIR. Two lexers are included in this change. 'llvm-mir' lexes the overall document format and delegates to 'llvm' and 'llvm-mir-body' as appropriate. 'llvm-mir-body' lexes the contents of the 'body:' attribute and can be used directly to syntax highlight code examples without including the document boilerplate. Since the 'llvm-mir' lexer delegates to the 'llvm' lexer at times, this change also adds the 'immarg' and 'willreturn' keywords to the 'llvm' lexer as these were missing.
Diffstat (limited to 'pygments/lexers/_mapping.py')
-rw-r--r--pygments/lexers/_mapping.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index 24bc173c..723949a1 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -253,6 +253,8 @@ LEXERS = {
'LiterateIdrisLexer': ('pygments.lexers.haskell', 'Literate Idris', ('lidr', 'literate-idris', 'lidris'), ('*.lidr',), ('text/x-literate-idris',)),
'LiveScriptLexer': ('pygments.lexers.javascript', 'LiveScript', ('live-script', 'livescript'), ('*.ls',), ('text/livescript',)),
'LlvmLexer': ('pygments.lexers.asm', 'LLVM', ('llvm',), ('*.ll',), ('text/x-llvm',)),
+ 'LlvmMirBodyLexer': ('pygments.lexers.asm', 'LLVM-MIR Body', ('llvm-mir-body',), (), ()),
+ 'LlvmMirLexer': ('pygments.lexers.asm', 'LLVM-MIR', ('llvm-mir',), ('*.mir',), ()),
'LogosLexer': ('pygments.lexers.objective', 'Logos', ('logos',), ('*.x', '*.xi', '*.xm', '*.xmi'), ('text/x-logos',)),
'LogtalkLexer': ('pygments.lexers.prolog', 'Logtalk', ('logtalk',), ('*.lgt', '*.logtalk'), ('text/x-logtalk',)),
'LuaLexer': ('pygments.lexers.scripting', 'Lua', ('lua',), ('*.lua', '*.wlua'), ('text/x-lua', 'application/x-lua')),