annotate runtime/syntax/raml.vim @ 16362:514e42de6a1d v8.1.1186

patch 8.1.1186: readdir() allocates list twice commit https://github.com/vim/vim/commit/334ad415040f9592451ec99498cd99f90d6e33e6 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 19 15:20:46 2019 +0200 patch 8.1.1186: readdir() allocates list twice Problem: readdir() allocates list twice. Solution: Remove second allocation. Also check for zero length.
author Bram Moolenaar <Bram@vim.org>
date Fri, 19 Apr 2019 15:30:05 +0200
parents 2b30a2b4bde2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14999
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: RAML (RESTful API Modeling Language)
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Eric Hopkins <eric.on.tech@gmail.com>
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " URL: https://github.com/in3d/vim-raml
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " License: Same as Vim
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " Last Change: 2018-11-03
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 if exists("b:current_syntax")
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 finish
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 endif
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 let s:cpo_save = &cpo
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 set cpo&vim
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 syn keyword ramlTodo contained TODO FIXME XXX NOTE
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 syn region ramlComment display oneline start='\%(^\|\s\)#' end='$'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 \ contains=ramlTodo,@Spell
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 syn region ramlVersion display oneline start='#%RAML' end='$'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 syn match ramlNodeProperty '!\%(![^\\^% ]\+\|[^!][^:/ ]*\)'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 syn match ramlAnchor '&.\+'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 syn match ramlAlias '\*.\+'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 syn match ramlDelimiter '[-,:]'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 syn match ramlBlock '[\[\]{}>|]'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 syn match ramlOperator '[?+-]'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 syn match ramlKey '\h\+\(?\)\?\ze\s*:'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 syn match ramlKey '\w\+\(\s\+\w\+\)*\(?\)\?\ze\s*:'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 syn match routeKey '\/\w\+\(\s\+\w\+\)*\ze\s*:'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 syn match routeKey 'application\/\w\+\ze\s*:'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 syn match routeParamKey '\/{\w\+}*\ze\s*:'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 syn region ramlString matchgroup=ramlStringDelimiter
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 \ start=+\s"+ skip=+\\"+ end=+"+
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 \ contains=ramlEscape
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 syn region ramlString matchgroup=ramlStringDelimiter
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 \ start=+\s'+ skip=+''+ end=+'+
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 \ contains=ramlStringEscape
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 syn region ramlParameter matchgroup=ramlParameterDelimiter
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 \ start=+<<+ skip=+''+ end=+>>+
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 syn match ramlEscape contained display +\\[\\"abefnrtv^0_ NLP]+
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 syn match ramlEscape contained display '\\x\x\{2}'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 syn match ramlEscape contained display '\\u\x\{4}'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 syn match ramlEscape contained display '\\U\x\{8}'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 syn match ramlEscape display '\\\%(\r\n\|[\r\n]\)'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 syn match ramlStringEscape contained +''+
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 syn match ramlNumber display
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 \ '\<[+-]\=\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\='
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 syn match ramlNumber display '0\o\+'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 syn match ramlNumber display '0x\x\+'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 syn match ramlNumber display '([+-]\=[iI]nf)'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 syn match ramlNumber display '(NaN)'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 syn match ramlConstant '\<[~yn]\>'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 syn keyword ramlConstant true True TRUE false False FALSE
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 syn keyword ramlConstant yes Yes on ON no No off OFF
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 syn keyword ramlConstant null Null NULL nil Nil NIL
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 syn keyword httpVerbs get post put delete head patch options
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 syn keyword ramlTypes string number integer date boolean file
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 syn match ramlTimestamp '\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\)\='
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 syn region ramlDocumentHeader start='---' end='$' contains=ramlDirective
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 syn match ramlDocumentEnd '\.\.\.'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 syn match ramlDirective contained '%[^:]\+:.\+'
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 hi def link ramlVersion String
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 hi def link routeInterpolation String
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 hi def link ramlInterpolation Constant
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 hi def link ramlTodo Todo
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 hi def link ramlComment Comment
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 hi def link ramlDocumentHeader PreProc
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 hi def link ramlDocumentEnd PreProc
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 hi def link ramlDirective Keyword
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 hi def link ramlNodeProperty Type
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 hi def link ramlAnchor Type
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 hi def link ramlAlias Type
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 hi def link ramlBlock Operator
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 hi def link ramlOperator Operator
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 hi def link routeParamKey SpecialChar
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 hi def link ramlKey Identifier
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 hi def link routeKey SpecialChar
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 hi def link ramlParameterDelimiter Type
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 hi def link ramlParameter Type
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 hi def link ramlString String
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 hi def link ramlStringDelimiter ramlString
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 hi def link ramlEscape SpecialChar
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 hi def link ramlStringEscape SpecialChar
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 hi def link ramlNumber Number
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 hi def link ramlConstant Constant
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 hi def link ramlTimestamp Number
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 hi def link httpVerbs Statement
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 hi def link ramlTypes Type
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 hi def link ramlDelimiter Delimiter
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 let b:current_syntax = "raml"
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 let &cpo = s:cpo_save
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 unlet s:cpo_save