annotate runtime/syntax/asterisk.vim @ 17907:4cf69f8d1ec6 v8.1.1950

patch 8.1.1950: using NULL pointer after an out-of-memory Commit: https://github.com/vim/vim/commit/4bbfb0f3cc67c00c8cee4e47283e8d760025219d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 31 15:28:02 2019 +0200 patch 8.1.1950: using NULL pointer after an out-of-memory Problem: Using NULL pointer after an out-of-memory. Solution: Check for NULL pointer. (Dominique Pelle, closes https://github.com/vim/vim/issues/4881)
author Bram Moolenaar <Bram@vim.org>
date Sat, 31 Aug 2019 15:30:04 +0200
parents 46763b01cd9a
children 17c4178f26ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
1 " Vim syntax file
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
2 " Language: Asterisk config file
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 792
diff changeset
3 " Maintainer: Jean Aunis <jean.aunis@yahoo.fr>
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 792
diff changeset
4 " Previous Maintainer: brc007
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
5 " Updated for 1.2 by Tilghman Lesher (Corydon76)
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 792
diff changeset
6 " Last Change: 2015 Feb 27
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
7 " version 0.4
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
8
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
9 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
10 if exists("b:current_syntax")
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
11 finish
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
12 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
13
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
14 syn sync clear
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
15 syn sync fromstart
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
16
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
17 syn keyword asteriskTodo TODO contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
18 syn match asteriskComment ";.*" contains=asteriskTodo
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
19 syn match asteriskContext "\[.\{-}\]"
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 792
diff changeset
20 syn match asteriskExten "^\s*\zsexten\s*=>\?\s*[^,]\+\ze," contains=asteriskPattern nextgroup=asteriskPriority
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 792
diff changeset
21 syn match asteriskExten "^\s*\zssame\s*=>\?\s*\ze" nextgroup=asteriskPriority
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
22 syn match asteriskExten "^\s*\(register\|channel\|ignorepat\|include\|\(no\)\?load\)\s*=>\?"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
23 syn match asteriskPattern "_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*]\)*\.\?" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
24 syn match asteriskPattern "[^A-Za-z0-9,]\zs[[:alnum:]#*]\+\ze" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
25 syn match asteriskApp ",\zs[a-zA-Z]\+\ze$"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
26 syn match asteriskApp ",\zs[a-zA-Z]\+\ze("
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
27 " Digits plus oldlabel (newlabel)
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 792
diff changeset
28 syn match asteriskPriority "\zs[[:digit:]]\+\(+[[:alpha:]][[:alnum:]_]*\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
29 " oldlabel plus digits (newlabel)
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 792
diff changeset
30 syn match asteriskPriority "\zs[[:alpha:]][[:alnum:]_]*+[[:digit:]]\+\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
31 " s or n plus digits (newlabel)
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 792
diff changeset
32 syn match asteriskPriority "\zs[sn]\(+[[:digit:]]\+\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
33 syn match asteriskLabel "(\zs[[:alpha:]][[:alnum:]]*\ze)" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
34 syn match asteriskError "^\s*#\s*[[:alnum:]]*"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
35 syn match asteriskInclude "^\s*#\s*\(include\|exec\)\s.*"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
36 syn match asteriskVar "\${_\{0,2}[[:alpha:]][[:alnum:]_]*\(:-\?[[:digit:]]\+\(:[[:digit:]]\+\)\?\)\?}"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
37 syn match asteriskVar "_\{0,2}[[:alpha:]][[:alnum:]_]*\ze="
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
38 syn match asteriskVarLen "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.*)}" contains=asteriskVar,asteriskVarLen,asteriskExp
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
39 syn match asteriskVarLen "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=asteriskVar,asteriskVarLen,asteriskExp
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
40 syn match asteriskExp "\$\[.\{-}\]" contains=asteriskVar,asteriskVarLen,asteriskExp
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
41 syn match asteriskCodecsPermit "^\s*\(allow\|disallow\)\s*=\s*.*$" contains=asteriskCodecs
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
42 syn match asteriskCodecs "\(g723\|gsm\|ulaw\|alaw\|g726\|adpcm\|slin\|lpc10\|g729\|speex\|ilbc\|all\s*$\)"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
43 syn match asteriskError "^\(type\|auth\|permit\|deny\|bindaddr\|host\)\s*=.*$"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
44 syn match asteriskType "^\zstype=\ze\<\(peer\|user\|friend\)\>$" contains=asteriskTypeType
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
45 syn match asteriskTypeType "\<\(peer\|user\|friend\)\>" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
46 syn match asteriskAuth "^\zsauth\s*=\ze\s*\<\(md5\|rsa\|plaintext\)\>$" contains=asteriskAuthType
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
47 syn match asteriskAuthType "\<\(md5\|rsa\|plaintext\)\>"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
48 syn match asteriskAuth "^\zs\(secret\|inkeys\|outkey\)\s*=\ze.*$"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
49 syn match asteriskAuth "^\(permit\|deny\)\s*=\s*\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\s*$" contains=asteriskIPRange
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
50 syn match asteriskIPRange "\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
51 syn match asteriskIP "\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
52 syn match asteriskHostname "[[:alnum:]][[:alnum:]\-\.]*\.[[:alpha:]]{2,10}" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
53 syn match asteriskPort "\d\{1,5}" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
54 syn match asteriskSetting "^bindaddr\s*=\s*\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}$" contains=asteriskIP
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
55 syn match asteriskSetting "^port\s*=\s*\d\{1,5}\s*$" contains=asteriskPort
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
56 syn match asteriskSetting "^host\s*=\s*\(dynamic\|\(\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)\|\([[:alnum:]][[:alnum:]\-\.]*\.[[:alpha:]]{2,10}\)\)" contains=asteriskIP,asteriskHostname
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
57
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
58 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
59 " Only when an item doesn't have highlighting yet
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
60
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
61 hi def link asteriskComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
62 hi def link asteriskExten String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
63 hi def link asteriskContext Preproc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
64 hi def link asteriskPattern Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
65 hi def link asteriskApp Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
66 hi def link asteriskInclude Preproc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
67 hi def link asteriskIncludeBad Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
68 hi def link asteriskPriority Preproc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
69 hi def link asteriskLabel Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
70 hi def link asteriskVar String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
71 hi def link asteriskVarLen Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
72 hi def link asteriskExp Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
73 hi def link asteriskCodecsPermit Preproc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
74 hi def link asteriskCodecs String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
75 hi def link asteriskType Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
76 hi def link asteriskTypeType Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
77 hi def link asteriskAuth String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
78 hi def link asteriskAuthType Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
79 hi def link asteriskIPRange Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
80 hi def link asteriskIP Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
81 hi def link asteriskPort Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
82 hi def link asteriskHostname Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
83 hi def link asteriskSetting Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
84 hi def link asteriskError Error
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
85
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
86 let b:current_syntax = "asterisk"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
87 " vim: ts=8 sw=2
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
88