1" Vim syntax file
2" Language:     Dot
3" Filenames:    *.dot
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
8
9" For version 5.x: Clear all syntax items
10" For version 6.x: Quit when a syntax file was already loaded
11if version < 600
12  syntax clear
13elseif exists("b:current_syntax")
14  finish
15endif
16
17" Errors
18syn match    dotParErr     ")"
19syn match    dotBrackErr   "]"
20syn match    dotBraceErr   "}"
21
22" Enclosing delimiters
23syn region   dotEncl transparent matchgroup=dotParEncl start="(" matchgroup=dotParEncl end=")" contains=ALLBUT,dotParErr
24syn region   dotEncl transparent matchgroup=dotBrackEncl start="\[" matchgroup=dotBrackEncl end="\]" contains=ALLBUT,dotBrackErr
25syn region   dotEncl transparent matchgroup=dotBraceEncl start="{" matchgroup=dotBraceEncl end="}" contains=ALLBUT,dotBraceErr
26
27" Comments
28syn region   dotComment start="//" end="$" contains=dotComment,dotTodo
29syn region   dotComment start="/\*" end="\*/" contains=dotComment,dotTodo
30syn keyword  dotTodo contained TODO FIXME XXX
31
32" Strings
33syn region   dotString    start=+"+ skip=+\\\\\|\\"+ end=+"+
34
35" General keywords
36syn keyword  dotKeyword  digraph node edge subgraph
37
38" Graph attributes
39syn keyword  dotType center layers margin mclimit name nodesep nslimit
40syn keyword  dotType ordering page pagedir rank rankdir ranksep ratio
41syn keyword  dotType rotate size
42
43" Node attributes
44syn keyword  dotType distortion fillcolor fontcolor fontname fontsize
45syn keyword  dotType height layer orientation peripheries regular
46syn keyword  dotType shape shapefile sides skew width
47
48" Edge attributes
49syn keyword  dotType arrowhead arrowsize arrowtail constraint decorateP
50syn keyword  dotType dir headclip headlabel labelangle labeldistance
51syn keyword  dotType labelfontcolor labelfontname labelfontsize
52syn keyword  dotType minlen port_label_distance samehead sametail
53syn keyword  dotType tailclip taillabel weight
54
55" Shared attributes (graphs, nodes, edges)
56syn keyword  dotType color
57
58" Shared attributes (graphs and edges)
59syn keyword  dotType bgcolor label URL
60
61" Shared attributes (nodes and edges)
62syn keyword  dotType fontcolor fontname fontsize layer style
63
64" Special chars
65syn match    dotKeyChar  "="
66syn match    dotKeyChar  ";"
67syn match    dotKeyChar  "->"
68
69" Identifier
70syn match    dotIdentifier /\<\w\+\>/
71
72" Synchronization
73syn sync minlines=50
74syn sync maxlines=500
75
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
79if version >= 508 || !exists("did_dot_syntax_inits")
80  if version < 508
81    let did_dot_syntax_inits = 1
82    command -nargs=+ HiLink hi link <args>
83  else
84    command -nargs=+ HiLink hi def link <args>
85  endif
86
87  HiLink dotParErr	 Error
88  HiLink dotBraceErr	 Error
89  HiLink dotBrackErr	 Error
90
91  HiLink dotComment	 Comment
92  HiLink dotTodo	 Todo
93
94  HiLink dotParEncl	 Keyword
95  HiLink dotBrackEncl	 Keyword
96  HiLink dotBraceEncl	 Keyword
97
98  HiLink dotKeyword	 Keyword
99  HiLink dotType	 Type
100  HiLink dotKeyChar	 Keyword
101
102  HiLink dotString	 String
103  HiLink dotIdentifier	 Identifier
104
105  delcommand HiLink
106endif
107
108let b:current_syntax = "dot"
109
110" vim: ts=8
111