llvm.org GIT mirror llvm / 908865d
Added support for: - defm and multiclass - imbricatable multiline C style comment - FIXME/TODO highlight in comment - binary and hexadecimal number - code using [{ }] is no highlighted as special (perhaps not the best choice) Patch by Cedric Venet! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50319 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 11 years ago
1 changed file(s) with 20 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
88 finish
99 endif
1010
11 " May be changed if you have a really slow machine
12 syntax sync minlines=100
13
1114 syn case match
1215
13 syn keyword tgKeyword def let in code dag field include
14 syn keyword tgType class int string list bit bits
15 " FIXME: this does not handle hex (0x...) or binary (0b...) constants
16 syn keyword tgKeyword def let in code dag field include defm
17 syn keyword tgType class int string list bit bits multiclass
18
1619 syn match tgNumber /\<\d\+\>/
1720 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=/"/
21 syn match tgNumber /\<0b[01]\+\>/
22 syn match tgNumber /\<0x[0-9a-fA-F]\+\>/
23 syn region tgString start=/"/ skip=/\\"/ end=/"/ oneline
24
25 syn region tgCode start=/\[{/ end=/}\]/
26
27 syn keyword tgTodo contained TODO FIXME
28 syn match tgComment /\/\/.*$/ contains=tgTodo
29 " Handle correctly imbricated comment
30 syn region tgComment2 matchgroup=tgComment2 start=+/\*+ end=+\*/+ contains=tgTodo,tgComment2
2231
2332 if version >= 508 || !exists("did_c_syn_inits")
2433 if version < 508
3241 HiLink tgType Type
3342 HiLink tgNumber Number
3443 HiLink tgComment Comment
44 HiLink tgComment2 Comment
3545 HiLink tgString String
46 " May find a better Hilight group...
47 HiLink tgCode Special
48 HiLink tgTodo Todo
3649
3750 delcommand HiLink
3851 endif