diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2022-10-14 17:40:10 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2022-10-14 17:40:10 +0200 |
commit | bc8a81d3592dab86334f27d1d43c080ebf680d42 (patch) | |
tree | f367857d8c196d36f2d6dec3c2f6c9d703b06b7c /syntax/mir.vim | |
parent | 38282d58387cff48ac203f6912c05e4c8686141b (diff) | |
download | vim-polyglot-bc8a81d3592dab86334f27d1d43c080ebf680d42.tar.gz vim-polyglot-bc8a81d3592dab86334f27d1d43c080ebf680d42.zip |
Update
Diffstat (limited to 'syntax/mir.vim')
-rw-r--r-- | syntax/mir.vim | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/syntax/mir.vim b/syntax/mir.vim new file mode 100644 index 00000000..55273945 --- /dev/null +++ b/syntax/mir.vim @@ -0,0 +1,52 @@ +if polyglot#init#is_disabled(expand('<sfile>:p'), 'llvm', 'syntax/mir.vim') + finish +endif + +" Vim syntax file +" Language: mir +" Maintainer: The LLVM team, http://llvm.org/ +" Version: $Revision$ + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn case match + +" MIR is embedded in a yaml container, so we load all of the yaml syntax. +runtime! syntax/yaml.vim +unlet b:current_syntax + +" The first document of a file is allowed to contain an LLVM IR module inside +" a top-level yaml block string. +syntax include @LLVM syntax/llvm.vim +" FIXME: This should only be allowed for the first document of the file +syntax region llvm start=/\(^---\s*|\)\@<=/ end=/\(^\.\.\.\)\@=/ contains=@LLVM + +" The `body:` field of a document contains the MIR dump of the function +syntax include @MIR syntax/machine-ir.vim +syntax region mir start=/\(^body:\s*|\)\@<=/ end=/\(^[^[:space:]]\)\@=/ contains=@MIR + +" Syntax-highlight lit test commands and bug numbers. +syn match mirSpecialComment /#\s*PR\d*\s*$/ +syn match mirSpecialComment /#\s*REQUIRES:.*$/ +syn match mirSpecialComment /#\s*RUN:.*$/ +syn match mirSpecialComment /#\s*ALLOW_RETRIES:.*$/ +syn match mirSpecialComment /#\s*CHECK:.*$/ +syn match mirSpecialComment "\v#\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$" +syn match mirSpecialComment /#\s*XFAIL:.*$/ + +if version >= 508 || !exists("did_c_syn_inits") + if version < 508 + let did_c_syn_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + HiLink mirSpecialComment SpecialComment +endif + +let b:current_syntax = "mir" |