4 " Maintainer: Markus Mottl <markus.mottl@gmail.com>
5 " URL: http://www.ocaml.info/vim/syntax/dot.vim
6 " Last Change: 2006 Feb 05
7 " 2001 May 04 - initial version
9 " For version 5.x: Clear all syntax items
10 " For version 6.x: Quit when a syntax file was already loaded
13 elseif exists("b:current_syntax")
18 syn match dotParErr ")"
19 syn match dotBrackErr "]"
20 syn match dotBraceErr "}"
22 " Enclosing delimiters
23 syn region dotEncl transparent matchgroup=dotParEncl start="(" matchgroup=dotParEncl end=")" contains=ALLBUT,dotParErr
24 syn region dotEncl transparent matchgroup=dotBrackEncl start="\[" matchgroup=dotBrackEncl end="\]" contains=ALLBUT,dotBrackErr
25 syn region dotEncl transparent matchgroup=dotBraceEncl start="{" matchgroup=dotBraceEncl end="}" contains=ALLBUT,dotBraceErr
28 syn region dotComment start="//" end="$" contains=dotComment,dotTodo
29 syn region dotComment start="/\*" end="\*/" contains=dotComment,dotTodo
30 syn keyword dotTodo contained TODO FIXME XXX
33 syn region dotString start=+"+ skip=+\\\\\|\\"+ end=+"+
36 syn keyword dotKeyword digraph node edge subgraph
39 syn keyword dotType center layers margin mclimit name nodesep nslimit
40 syn keyword dotType ordering page pagedir rank rankdir ranksep ratio
41 syn keyword dotType rotate size
44 syn keyword dotType distortion fillcolor fontcolor fontname fontsize
45 syn keyword dotType height layer orientation peripheries regular
46 syn keyword dotType shape shapefile sides skew width
49 syn keyword dotType arrowhead arrowsize arrowtail constraint decorateP
50 syn keyword dotType dir headclip headlabel labelangle labeldistance
51 syn keyword dotType labelfontcolor labelfontname labelfontsize
52 syn keyword dotType minlen port_label_distance samehead sametail
53 syn keyword dotType tailclip taillabel weight
55 " Shared attributes (graphs, nodes, edges)
56 syn keyword dotType color
58 " Shared attributes (graphs and edges)
59 syn keyword dotType bgcolor label URL
61 " Shared attributes (nodes and edges)
62 syn keyword dotType fontcolor fontname fontsize layer style
65 syn match dotKeyChar "="
66 syn match dotKeyChar ";"
67 syn match dotKeyChar "->"
70 syn match dotIdentifier /\<\w\+\>/
76 " Define the default highlighting.
77 " For version 5.7 and earlier: only when not done already
78 " For version 5.8 and later: only when an item doesn't have highlighting yet
79 if version >= 508 || !exists("did_dot_syntax_inits")
81 let did_dot_syntax_inits = 1
82 command -nargs=+ HiLink hi link <args>
84 command -nargs=+ HiLink hi def link <args>
87 HiLink dotParErr Error
88 HiLink dotBraceErr Error
89 HiLink dotBrackErr Error
91 HiLink dotComment Comment
94 HiLink dotParEncl Keyword
95 HiLink dotBrackEncl Keyword
96 HiLink dotBraceEncl Keyword
98 HiLink dotKeyword Keyword
100 HiLink dotKeyChar Keyword
102 HiLink dotString String
103 HiLink dotIdentifier Identifier
108 let b:current_syntax = "dot"