tablegen.vim:
[oota-llvm.git] / utils / vim / tablegen.vim
1 " Vim syntax file
2 " Language:   TableGen
3 " Maintainer: The LLVM team, http://llvm.cs.uiuc.edu/
4 " Updated:    2003-08-11
5
6 if version < 600
7   syntax clear
8 elseif exists("b:current_syntax")
9   finish
10 endif
11
12 syn case match
13
14 syn keyword tgKeyword   def let in code dag field
15 syn keyword tgType      class int string list bit bits 
16 syn match   tgNumber    /\<\d\+\>/
17 syn match   tgNumber    /\<\d\+\.\d*\>/
18 syn match   tgComment   /\/\/.*$/
19 " FIXME: this does not capture multi-line C-style comments
20 syn match   tgComment   /\/\*.*\*\//
21 syn region  tgString    start=/"/ skip=/\\"/ end=/"/
22
23 if version >= 508 || !exists("did_c_syn_inits")
24   if version < 508
25     let did_c_syn_inits = 1
26     command -nargs=+ HiLink hi link <args>
27   else
28     command -nargs=+ HiLink hi def link <args>
29   endif
30
31   HiLink tgKeyword Statement
32   HiLink tgType Type
33   HiLink tgNumber Number
34   HiLink tgComment Comment
35   HiLink tgString String
36
37   delcommand HiLink
38 endif
39  
40 let b:current_syntax = "tablegen"