2002-10-08 00:54:48 +02:00
|
|
|
" Vim syntax file
|
2003-06-03 02:56:09 +02:00
|
|
|
" Language: llvm
|
2006-03-14 06:54:52 +01:00
|
|
|
" Maintainer: The LLVM team, http://llvm.org/
|
2003-06-03 02:56:09 +02:00
|
|
|
" Updated: 2003-06-02
|
2002-10-08 00:54:48 +02:00
|
|
|
|
|
|
|
if version < 600
|
|
|
|
syntax clear
|
|
|
|
elseif exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
syn case match
|
|
|
|
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmType void float double
|
|
|
|
syn keyword llvmType x86_fp80 fp128 ppc_fp128
|
2002-10-08 00:54:48 +02:00
|
|
|
syn keyword llvmType type label opaque
|
2008-01-29 13:35:50 +01:00
|
|
|
syn match llvmType /\<i\d\+\>/
|
2002-10-08 00:54:48 +02:00
|
|
|
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmStatement add sub mul sdiv udiv fdiv srem urem frem
|
2002-10-08 00:54:48 +02:00
|
|
|
syn keyword llvmStatement and or xor
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmStatement icmp fcmp
|
|
|
|
syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle
|
|
|
|
syn keyword llvmStatement false oeq ogt oge olt ole one ord ueq ugt uge
|
|
|
|
syn keyword llvmStatement ult ule une uno true
|
2002-10-08 00:54:48 +02:00
|
|
|
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmStatement phi tail call to select shl lshr ashr va_arg
|
|
|
|
syn keyword llvmStatement trunc zext sext
|
|
|
|
syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp
|
|
|
|
syn keyword llvmStatement ptrtoint inttoptr bitcast
|
2004-10-16 20:24:35 +02:00
|
|
|
syn keyword llvmStatement ret br switch invoke unwind unreachable
|
2002-10-08 00:54:48 +02:00
|
|
|
syn keyword llvmStatement malloc alloca free load store getelementptr
|
|
|
|
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmStatement true false zeroinitializer
|
|
|
|
syn keyword llvmStatement define declare global constant const
|
2003-04-16 22:25:57 +02:00
|
|
|
syn keyword llvmStatement internal uninitialized external implementation
|
2003-10-10 06:56:26 +02:00
|
|
|
syn keyword llvmStatement linkonce weak appending
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmStatement undef null to except target datalayout triple deplibs
|
2005-05-13 22:40:52 +02:00
|
|
|
syn keyword llvmStatement big little volatile fastcc coldcc cc
|
2008-01-29 13:35:50 +01:00
|
|
|
syn keyword llvmStatement extractelement insertelement shufflevector
|
|
|
|
syn keyword llvmStatement module asm align
|
2002-10-08 00:54:48 +02:00
|
|
|
|
|
|
|
"syn match llvmFunction /%[a-zA-Z\$._\-][a-zA-Z\$._\-0-9]*/
|
2003-06-03 02:56:09 +02:00
|
|
|
syn match llvmNumber /\<\d\+\>/
|
|
|
|
syn match llvmNumber /\<\d\+\.\d*\>/
|
2002-10-08 00:54:48 +02:00
|
|
|
|
2003-06-03 02:56:09 +02:00
|
|
|
syn match llvmComment /;.*$/
|
2002-10-08 00:54:48 +02:00
|
|
|
syn region llvmString start=/"/ skip=/\\"/ end=/"/
|
2003-06-03 02:56:09 +02:00
|
|
|
syn match llvmLabel /[\-a-zA-Z\$._0-9]*:/
|
2002-10-08 00:54:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
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"
|