annotate runtime/syntax/calendar.vim @ 7014:962b3ae252a9 v7.4.824

patch 7.4.824 Problem: Can't compile without the multi-byte feature. (John Marriott) Solution: Add #ifdef.
author Bram Moolenaar <bram@vim.org>
date Wed, 12 Aug 2015 22:56:58 +0200
parents 1f3b1021f002
children 1218c5353e2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
2 " Language: calendar(1) input file
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
4 " Latest Revision: 2006-04-19
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
6 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
10 let s:cpo_save = &cpo
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
11 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
13 syn keyword calendarTodo contained TODO FIXME XXX NOTE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
15 syn region calendarComment start='/\*' end='\*/'
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
16 \ contains=calendarTodo,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
18 syn region calendarCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
19 \ end=+"+ end='$' contains=calendarSpecial
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
20 syn match calendarSpecial display contained '\\\%(x\x\+\|\o\{1,3}\|.\|$\)'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
21 syn match calendarSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
23 syn region calendarPreCondit start='^\s*#\s*\%(if\|ifdef\|ifndef\|elif\)\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
24 \ skip='\\$' end='$'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
25 \ contains=calendarComment,calendarCppString
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
26 syn match calendarPreCondit display '^\s*#\s*\%(else\|endif\)\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
27 syn region calendarCppOut start='^\s*#\s*if\s\+0\+' end='.\@=\|$'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
28 \ contains=calendarCppOut2
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
29 syn region calendarCppOut2 contained start='0'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
30 \ end='^\s*#\s*\%(endif\|else\|elif\)\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
31 \ contains=calendarSpaceError,calendarCppSkip
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
32 syn region calendarCppSkip contained
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
33 \ start='^\s*#\s*\%(if\|ifdef\|ifndef\)\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
34 \ skip='\\$' end='^\s*#\s*endif\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
35 \ contains=calendarSpaceError,calendarCppSkip
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
36 syn region calendarIncluded display contained start=+"+ skip=+\\\\\|\\"+
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
37 \ end=+"+
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
38 syn match calendarIncluded display contained '<[^>]*>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
39 syn match calendarInclude display '^\s*#\s*include\>\s*["<]'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
40 \ contains=calendarIncluded
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
41 syn cluster calendarPreProcGroup contains=calendarPreCondit,calendarIncluded,
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
42 \ calendarInclude,calendarDefine,
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
43 \ calendarCppOut,calendarCppOut2,
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
44 \ calendarCppSkip,calendarString,
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
45 \ calendarSpecial,calendarTodo
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
46 syn region calendarDefine start='^\s*#\s*\%(define\|undef\)\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
47 \ skip='\\$' end='$'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
48 \ contains=ALLBUT,@calendarPreProcGroup
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
49 syn region calendarPreProc start='^\s*#\s*\%(pragma\|line\|warning\|warn\|error\)\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
50 \ skip='\\$' end='$' keepend
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
51 \ contains=ALLBUT,@calendarPreProcGroup
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
53 syn keyword calendarKeyword CHARSET BODUN LANG
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn case ignore
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
55 syn keyword calendarKeyword Easter Pashka
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
58 syn case ignore
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
59 syn match calendarNumber display '\<\d\+\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
60 syn keyword calendarMonth Jan[uary] Feb[ruary] Mar[ch] Apr[il] May
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
61 \ Jun[e] Jul[y] Aug[ust] Sep[tember]
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
62 \ Oct[ober] Nov[ember] Dec[ember]
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
63 syn match calendarMonth display '\<\%(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)\.'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
64 syn keyword calendarWeekday Mon[day] Tue[sday] Wed[nesday] Thu[rsday]
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
65 syn keyword calendarWeekday Fri[day] Sat[urday] Sun[day]
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
66 syn match calendarWeekday display '\<\%(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\)\.'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
67 \ nextgroup=calendarWeekdayMod
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
68 syn match calendarWeekdayMod display '[+-]\d\+\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
69 syn case match
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
71 syn match calendarTime display '\<\%([01]\=\d\|2[0-3]\):[0-5]\d\%(:[0-5]\d\)\='
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
72 syn match calendarTime display '\<\%(0\=[1-9]\|1[0-2]\):[0-5]\d\%(:[0-5]\d\)\=\s*[AaPp][Mm]'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
73
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
74 syn match calendarVariable '\*'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
76 if exists("c_minlines")
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
77 let b:c_minlines = c_minlines
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
78 else
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
79 if !exists("c_no_if0")
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
80 let b:c_minlines = 50 " #if 0 constructs can be long
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
81 else
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
82 let b:c_minlines = 15 " mostly for () constructs
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
83 endif
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
84 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 exec "syn sync ccomment calendarComment minlines=" . b:c_minlines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
87 hi def link calendarTodo Todo
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
88 hi def link calendarComment Comment
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
89 hi def link calendarCppString String
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
90 hi def link calendarSpecial SpecialChar
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
91 hi def link calendarPreCondit PreCondit
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
92 hi def link calendarCppOut Comment
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
93 hi def link calendarCppOut2 calendarCppOut
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
94 hi def link calendarCppSkip calendarCppOut
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
95 hi def link calendarIncluded String
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
96 hi def link calendarInclude Include
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
97 hi def link calendarDefine Macro
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
98 hi def link calendarPreProc PreProc
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
99 hi def link calendarKeyword Keyword
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
100 hi def link calendarNumber Number
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
101 hi def link calendarMonth String
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
102 hi def link calendarWeekday String
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
103 hi def link calendarWeekdayMod Special
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
104 hi def link calendarTime Number
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
105 hi def link calendarVariable Identifier
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 let b:current_syntax = "calendar"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
109 let &cpo = s:cpo_save
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
110 unlet s:cpo_save