annotate runtime/syntax/yaml.vim @ 2223:81b83a19e127 vim73

More strict checks for the undo file.
author Bram Moolenaar <bram@vim.org>
date Wed, 26 May 2010 21:21:00 +0200
parents f4f8014d516e
children dc2e5ec0500d
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)
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
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
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
13 syn keyword yamlTodo contained TODO FIXME XXX NOTE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
15 syn region yamlComment display oneline start='\%(^\|\s\)#' end='$'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
16 \ contains=yamlTodo,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
18 syn match yamlNodeProperty '!\%(![^\\^% ]\+\|[^!][^:/ ]*\)'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
20 syn match yamlAnchor '&.\+'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
21
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
22 syn match yamlAlias '\*.\+'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
24 syn match yamlDelimiter '[-,:]'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
25 syn match yamlBlock '[\[\]{}>|]'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
26 syn match yamlOperator '[?+-]'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
27 syn match yamlKey '\w\+\(\s\+\w\+\)*\ze\s*:'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
29 syn region yamlString start=+"+ skip=+\\"+ end=+"+
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
30 \ contains=yamlEscape
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
31 syn region yamlString start=+'+ skip=+''+ end=+'+
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
32 \ contains=yamlSingleEscape
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
33 syn match yamlEscape contained display +\\[\\"abefnrtv^0_ NLP]+
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
34 syn match yamlEscape contained display '\\x\x\{2}'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
35 syn match yamlEscape contained display '\\u\x\{4}'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
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?
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
38 syn match yamlEscape display '\\\%(\r\n\|[\r\n]\)'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
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)
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
42 syn match yamlNumber display
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
43 \ '\<[+-]\=\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\='
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
44 syn match yamlNumber display '0\o\+'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
45 syn match yamlNumber display '0x\x\+'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
46 syn match yamlNumber display '([+-]\=[iI]nf)'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
47 syn match yamlNumber display '(NaN)'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
49 syn match yamlConstant '\<[~yn]\>'
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
50 syn keyword yamlConstant true True TRUE false False FALSE
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
51 syn keyword yamlConstant yes Yes on ON no No off OFF
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
52 syn keyword yamlConstant null Null NULL nil Nil NIL
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
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
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
56 syn region yamlDocumentHeader start='---' end='$' contains=yamlDirective
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
diff changeset
57 syn match yamlDocumentEnd '\.\.\.'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1618
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