blob: a7378916f938746c16e606599a25ed51472a9efc [file] [log] [blame]
Bram Moolenaar2346a632021-06-13 19:02:49 +02001" Vim syntax file
2" Language: Graphviz program
3" Maintainer: Matthew Fernandez <matthew.fernandez@gmail.com>
4" Last Change: Tue, 28 Jul 2020 17:20:44 -0700
5
6if exists("b:current_syntax")
7 finish
8endif
9
10let s:cpo_save = &cpo
11set cpo&vim
12
13syn keyword gvArg ARGC ARGV
14syn keyword gvBeg BEGIN BEG_G N E END END_G
15syn keyword gvFunc
16 \ graph fstsubg isDirect isStrict isSubg nEdges nNodes nxtsubg subg
17 \ degreeOf fstnode indegreeOf isNode isSubnode node nxtnode nxtnode_sg
18 \ outDegreeOf subnode
19 \ edge edge_sg fstedge fstedge_sg fstin fstin_sg fstout fstout_sg isEdge
20 \ isEdge_sg isSubedge nxtedge nxtedge_sg nxtin nxtin_sg nxtout nxtout_sg opp
21 \ subedge
22 \ freadG fwriteG readG write[] writeG
23 \ aget aset clone cloneG compOf copy[] copyA delete[] fstAttr getDflt hasAttr
24 \ induce isAttr isIn kindOf lock[] nxtAttr setDflt
25 \ canon gsub html index ishtml length llOf match[] rindex split[] sprintf
26 \ sscanf strcmp sub substr tokens tolower toupper urOf xOf yOf
27 \ closeF openF print[] printf scanf readL
28 \ atan2 cos exp log MAX MIN pow sin[] sqrt
29 \ in[] unset
30 \ colorx exit[] rand srand system
31syn keyword gvCons
32 \ NULL TV_bfs TV_dfs TV_en TV_flat TV_fwd TV_ne TV_prepostdfs TV_prepostfwd
33 \ TV_prepostrev TV_postdfs TV_postfwd tv_postrev TV_rev
34syn keyword gvType char double float int long unsigned void
35 \ string
36 \ edge_t graph_t node_t obj_t
37syn match gvVar
38 \ "\$\(\(F\|G\|NG\|O\|T\|tgtname\|tvedge\|tvnext\|tvroot\|tvtype\)\>\)\?\(\<\)\@!"
39syn keyword gvWord break continue else for forr if return switch while
40
41" numbers adapted from c.vim's cNumbers and friends
42syn match gvNums transparent "\<\d\|\.\d" contains=gvNumber,gvFloat,gvOctal
43syn match gvNumber contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
44syn match gvNumber contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
45syn match gvOctal contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=gvOctalZero
46syn match gvOctalZero contained "\<0"
47syn match gvFloat contained "\d\+f"
48syn match gvFloat contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
49syn match gvFloat contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
50syn match gvFloat contained "\d\+e[-+]\=\d\+[fl]\=\>"
51
52syn region gvString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gvFormat,gvSpecial extend
53syn region gvString start="'" skip="\\\\\|\\'" end="'" contains=gvFormat,gvSpecial extend
54
55" adapted from c.vim's cFormat for c_no_c99
56syn match gvFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
57
58syn match gvSpecial "\\." contained
59
60syn region gvCComment start="//" skip="\\$" end="$" keepend
61syn region gvCPPComment start="#" skip="\\$" end="$" keepend
62syn region gvCXXComment start="/\*" end="\*/" fold
63
64hi def link gvArg Identifier
65hi def link gvBeg Keyword
66hi def link gvFloat Number
67hi def link gvFunc Identifier
68hi def link gvCons Number
69hi def link gvNumber Number
70hi def link gvType Type
71hi def link gvVar Statement
72hi def link gvWord Keyword
73
74hi def link gvString String
75hi def link gvFormat Special
76hi def link gvSpecial Special
77
78hi def link gvCComment Comment
79hi def link gvCPPComment Comment
80hi def link gvCXXComment Comment
81
82let b:current_syntax = "gvpr"
83
84let &cpo = s:cpo_save
85unlet s:cpo_save