diff options
author | Nick Hildenbrandt <hldnbrnd@uiuc.edu> | 2002-10-07 22:54:48 +0000 |
---|---|---|
committer | Nick Hildenbrandt <hldnbrnd@uiuc.edu> | 2002-10-07 22:54:48 +0000 |
commit | 75f79b9b0ec0ec9807ce4b4b0a802c20c91e896b (patch) | |
tree | 826fd24acfc4a5a234766ec86b0ca63262e66c1a /utils/vim | |
parent | 9106a588060085316895a9b256909d795c2f5b5e (diff) | |
download | external_llvm-75f79b9b0ec0ec9807ce4b4b0a802c20c91e896b.zip external_llvm-75f79b9b0ec0ec9807ce4b4b0a802c20c91e896b.tar.gz external_llvm-75f79b9b0ec0ec9807ce4b4b0a802c20c91e896b.tar.bz2 |
LLVM syntax highlighting for VIM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4067 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/vim')
-rw-r--r-- | utils/vim/llvm.vim | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/utils/vim/llvm.vim b/utils/vim/llvm.vim new file mode 100644 index 0000000..f2c736d --- /dev/null +++ b/utils/vim/llvm.vim @@ -0,0 +1,59 @@ +" Vim syntax file +" Language: llvm +" Maintainer: Nick Hildenbrandt <hldnbrnd@uiuc.edu> +" Updated: 2002-10-07 + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn case match + +syn keyword llvmType void bool sbyte ubyte +syn keyword llvmType short ushort int uint +syn keyword llvmType long ulong float double +syn keyword llvmType type label opaque + +syn keyword llvmStatement add sub mul div rem +syn keyword llvmStatement and or xor +syn keyword llvmStatement setne seteq setlt setgt setle setge + +syn keyword llvmStatement phi call cast shl shr +syn keyword llvmStatement ret br switch invoke +syn keyword llvmStatement malloc alloca free load store getelementptr + +syn keyword llvmStatement begin end true false +syn keyword llvmStatement declare global constant const +syn keyword llvmStatement internal unititialized external implementation +syn keyword llvmStatement null to except not + +"syn match llvmFunction /%[a-zA-Z\$._\-][a-zA-Z\$._\-0-9]*/ +syn match llvmNumber /\<\d\+\>/ +syn match llvmNumber /\<\d\+\.\d*\>/ + +syn match llvmComment /;.*$/ +syn region llvmString start=/"/ skip=/\\"/ end=/"/ +syn match llvmLabel /[\-a-zA-Z\$._0-9]*:/ + + +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 llvmType Type + HiLink llvmStatement Statement + HiLink llvmNumber Number + HiLink llvmComment Comment + HiLink llvmString String + HiLink llvmLabel Label + + delcommand HiLink +endif + +let b:current_syntax = "llvm" |