| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 1 | " Vim syntax file | 
|  | 2 | " Language:   TableGen | 
| Reid Spencer | c67a060 | 2006-03-14 05:54:52 +0000 | [diff] [blame] | 3 | " Maintainer: The LLVM team, http://llvm.org/ | 
| Dan Gohman | 1b9dd24 | 2010-02-26 21:38:04 +0000 | [diff] [blame] | 4 | " Version:    $Revision$ | 
| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 5 |  | 
|  | 6 | if version < 600 | 
|  | 7 | syntax clear | 
|  | 8 | elseif exists("b:current_syntax") | 
|  | 9 | finish | 
|  | 10 | endif | 
|  | 11 |  | 
| Bill Wendling | d8c2d29 | 2008-04-27 09:44:10 +0000 | [diff] [blame] | 12 | " May be changed if you have a really slow machine | 
|  | 13 | syntax sync minlines=100 | 
|  | 14 |  | 
| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 15 | syn case match | 
|  | 16 |  | 
| David Greene | fb927af | 2012-02-22 16:09:41 +0000 | [diff] [blame] | 17 | syn keyword tgKeyword   def let in code dag field include defm foreach | 
| Bill Wendling | d8c2d29 | 2008-04-27 09:44:10 +0000 | [diff] [blame] | 18 | syn keyword tgType      class int string list bit bits multiclass | 
|  | 19 |  | 
| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 20 | syn match   tgNumber    /\<\d\+\>/ | 
|  | 21 | syn match   tgNumber    /\<\d\+\.\d*\>/ | 
| Bill Wendling | d8c2d29 | 2008-04-27 09:44:10 +0000 | [diff] [blame] | 22 | syn match   tgNumber    /\<0b[01]\+\>/ | 
|  | 23 | syn match   tgNumber    /\<0x[0-9a-fA-F]\+\>/ | 
|  | 24 | syn region  tgString    start=/"/ skip=/\\"/ end=/"/    oneline | 
|  | 25 |  | 
|  | 26 | syn region  tgCode      start=/\[{/ end=/}\]/ | 
|  | 27 |  | 
|  | 28 | syn keyword tgTodo             contained TODO FIXME | 
|  | 29 | syn match   tgComment   /\/\/.*$/         contains=tgTodo | 
|  | 30 | " Handle correctly imbricated comment | 
|  | 31 | syn region  tgComment2 matchgroup=tgComment2  start=+/\*+ end=+\*/+ contains=tgTodo,tgComment2 | 
| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 32 |  | 
|  | 33 | if version >= 508 || !exists("did_c_syn_inits") | 
|  | 34 | if version < 508 | 
|  | 35 | let did_c_syn_inits = 1 | 
|  | 36 | command -nargs=+ HiLink hi link <args> | 
|  | 37 | else | 
|  | 38 | command -nargs=+ HiLink hi def link <args> | 
|  | 39 | endif | 
|  | 40 |  | 
| Misha Brukman | 216ed65 | 2003-08-11 18:05:19 +0000 | [diff] [blame] | 41 | HiLink tgKeyword Statement | 
| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 42 | HiLink tgType Type | 
| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 43 | HiLink tgNumber Number | 
|  | 44 | HiLink tgComment Comment | 
| Bill Wendling | d8c2d29 | 2008-04-27 09:44:10 +0000 | [diff] [blame] | 45 | HiLink tgComment2 Comment | 
| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 46 | HiLink tgString String | 
| Bill Wendling | d8c2d29 | 2008-04-27 09:44:10 +0000 | [diff] [blame] | 47 | " May find a better Hilight group... | 
|  | 48 | HiLink tgCode Special | 
|  | 49 | HiLink tgTodo Todo | 
| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 50 |  | 
|  | 51 | delcommand HiLink | 
|  | 52 | endif | 
| Misha Brukman | ac7b456 | 2009-01-02 16:26:14 +0000 | [diff] [blame] | 53 |  | 
| Misha Brukman | 61e66ba | 2003-08-11 17:56:08 +0000 | [diff] [blame] | 54 | let b:current_syntax = "tablegen" |