summaryrefslogtreecommitdiffstats
path: root/vim/syntax/ssa.vim
blob: 2fb31c6204b8cbd7c921f0974e28a995f8a7d6ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
" Vim syntax file
" Language:          SSA (Sub Station Alpha)
" Maintainer:        Don Yang <omoikane@uguu.org>
" Latest Revision:   2004-05-06


if version < 600
   syntax clear
elseif exists("b:current_syntax")
   finish
endif
if !exists("main_syntax")
   let main_syntax = "ssa"
endif


syn match ssaSection       "^\[.*\]"
syn match ssaSourceComment "^;.*$"
syn match ssaLine          "^[^;][^:]*:.*$"  contains=ssaHeader,ssaComment,ssaDialog

syn match ssaHeader        "^[^;][^:]*:\s*"  contained nextgroup=ssaHeaderText
syn match ssaHeaderText    ".*$"             contained

syn match ssaComment       "^Comment:\s*"    contained nextgroup=ssaCommentText
syn match ssaCommentText   ".*$"             contained

syn match ssaDialog        "^Dialogue:\s*"   contained nextgroup=ssaDialogTimes
syn match ssaDialogTimes   "\([^,]*,\)\{4}"  contained nextgroup=ssaDialogActor
syn match ssaDialogActor   "[^,]*"           contained nextgroup=ssaDialogEffects
syn match ssaDialogEffects ",\([^,]*,\)\{4}" contained nextgroup=ssaDialogText
syn match ssaDialogText    ".*$"             contained contains=ssaTextComment,ssaTextSubCode

syn match ssaTextComment   "{[^}]*}"         contained
syn match ssaTextSubCode   "{\\[^}]*}"       contained


hi link ssaSection         Directory
hi link ssaSourceComment   Directory

hi link ssaHeader          Label
hi link ssaComment         Label
hi link ssaDialog          Label

hi link ssaHeaderText      Constant
hi link ssaCommentText     Comment
hi link ssaDialogTimes     Comment
hi link ssaDialogActor     Title
hi link ssaDialogEffects   Comment
hi link ssaDialogText      Normal

hi link ssaTextComment     Comment
hi link ssaTextSubCode     Identifier


let b:current_syntax = "ssa"
if main_syntax == "ssa"
   unlet main_syntax
endif