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