annotate runtime/syntax/yaml.vim @ 415:165c628aa9fc v7.0108

updated for version 7.0108
author vimboss
date Tue, 12 Jul 2005 22:50:18 +0000
parents 4fe8e1a7758e
children 1f3b1021f002
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: YAML (YAML Ain't Markup Language)
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
3 " Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
4 " Latest Revision: 2005-07-04
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 yamlTodo 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 yamlComment display oneline start='\%(^\|\s\)#' end='$'
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
16 \ contains=yamlTodo,@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 match yamlNodeProperty '!\%(![^\\^% ]\+\|[^!][^:/ ]*\)'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
20 syn match yamlAnchor '&.\+'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
21
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
22 syn match yamlAlias '\*.\+'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
24 syn match yamlDelimiter '[-,:]'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
25 syn match yamlBlock '[\[\]{}>|]'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
26 syn match yamlOperator '[?+-]'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
27 syn match yamlKey '\w\+\(\s\+\w\+\)*\ze\s*:'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
29 syn region yamlString start=+"+ skip=+\\"+ end=+"+
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
30 \ contains=yamlEscape
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
31 syn region yamlString start=+'+ skip=+''+ end=+'+
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
32 \ contains=yamlSingleEscape
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
33 syn match yamlEscape contained display +\\[\\"abefnrtv^0_ NLP]+
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
34 syn match yamlEscape contained display '\\x\x\{2}'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
35 syn match yamlEscape contained display '\\u\x\{4}'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
36 syn match yamlEscape contained display '\\U\x\{8}'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " TODO: how do we get 0x85, 0x2028, and 0x2029 into this?
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
38 syn match yamlEscape display '\\\%(\r\n\|[\r\n]\)'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
39 syn match yamlSingleEscape contained display +''+
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
41 " TODO: sexagecimal and fixed (20:30.15 and 1,230.15)
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
42 syn match yamlNumber display
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
43 \ '\<[+-]\=\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\='
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
44 syn match yamlNumber display '0\o\+'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
45 syn match yamlNumber display '0x\x\+'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
46 syn match yamlNumber display '([+-]\=[iI]nf)'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
47 syn match yamlNumber display '(NaN)'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
49 syn match yamlConstant '\<[~yn]\>'
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
50 syn keyword yamlConstant true True TRUE false False FALSE
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
51 syn keyword yamlConstant yes Yes on ON no No off OFF
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
52 syn keyword yamlConstant null Null NULL nil Nil NIL
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
54 syn match yamlTimestamp '\d\d\d\d-\%(1[0-2]\|\d\)-\%(3[0-2]\|2\d\|1\d\|\d\)\%( \%([01]\d\|2[0-3]\):[0-5]\d:[0-5]\d.\d\d [+-]\%([01]\d\|2[0-3]\):[0-5]\d\|t\%([01]\d\|2[0-3]\):[0-5]\d:[0-5]\d.\d\d[+-]\%([01]\d\|2[0-3]\):[0-5]\d\|T\%([01]\d\|2[0-3]\):[0-5]\d:[0-5]\d.\dZ\)\='
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
56 syn region yamlDocumentHeader start='---' end='$' contains=yamlDirective
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
57 syn match yamlDocumentEnd '\.\.\.'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
59 syn match yamlDirective contained '%[^:]\+:.\+'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
61 hi def link yamlTodo Todo
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
62 hi def link yamlComment Comment
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
63 hi def link yamlDocumentHeader PreProc
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
64 hi def link yamlDocumentEnd PreProc
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
65 hi def link yamlDirective Keyword
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
66 hi def link yamlNodeProperty Type
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
67 hi def link yamlAnchor Type
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
68 hi def link yamlAlias Type
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
69 hi def link yamlDelimiter Delimiter
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
70 hi def link yamlBlock Operator
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
71 hi def link yamlOperator Operator
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
72 hi def link yamlKey Identifier
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
73 hi def link yamlString String
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
74 hi def link yamlEscape SpecialChar
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
75 hi def link yamlSingleEscape SpecialChar
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
76 hi def link yamlNumber Number
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
77 hi def link yamlConstant Constant
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
78 hi def link yamlTimestamp Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 let b:current_syntax = "yaml"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
82 let &cpo = s:cpo_save
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
83 unlet s:cpo_save