annotate runtime/syntax/asterisk.vim @ 997:86289e90a4bb v7.0.123

updated for version 7.0-123
author vimboss
date Tue, 10 Oct 2006 09:41:28 +0000
parents 860b73800cd7
children 3af822eb4da5
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
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
3 " Maintainer: brc007
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
4 " Updated for 1.2 by Tilghman Lesher (Corydon76)
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
5 " Last Change: 2006 Mar 20
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
6 " version 0.4
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
7 "
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
8 if version < 600
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
9 syntax clear
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
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 "\[.\{-}\]"
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
20 syn match asteriskExten "^\s*exten\s*=>\?\s*[^,]\+" contains=asteriskPattern
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
21 syn match asteriskExten "^\s*\(register\|channel\|ignorepat\|include\|\(no\)\?load\)\s*=>\?"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
22 syn match asteriskPattern "_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*]\)*\.\?" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
23 syn match asteriskPattern "[^A-Za-z0-9,]\zs[[:alnum:]#*]\+\ze" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
24 syn match asteriskApp ",\zs[a-zA-Z]\+\ze$"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
25 syn match asteriskApp ",\zs[a-zA-Z]\+\ze("
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
26 " Digits plus oldlabel (newlabel)
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
27 syn match asteriskPriority ",\zs[[:digit:]]\+\(+[[:alpha:]][[:alnum:]_]*\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
28 " oldlabel plus digits (newlabel)
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
29 syn match asteriskPriority ",\zs[[:alpha:]][[:alnum:]_]*+[[:digit:]]\+\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
30 " s or n plus digits (newlabel)
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
31 syn match asteriskPriority ",\zs[sn]\(+[[:digit:]]\+\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
32 syn match asteriskLabel "(\zs[[:alpha:]][[:alnum:]]*\ze)" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
33 syn match asteriskError "^\s*#\s*[[:alnum:]]*"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
34 syn match asteriskInclude "^\s*#\s*\(include\|exec\)\s.*"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
35 syn match asteriskVar "\${_\{0,2}[[:alpha:]][[:alnum:]_]*\(:-\?[[:digit:]]\+\(:[[:digit:]]\+\)\?\)\?}"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
36 syn match asteriskVar "_\{0,2}[[:alpha:]][[:alnum:]_]*\ze="
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
37 syn match asteriskVarLen "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.*)}" contains=asteriskVar,asteriskVarLen,asteriskExp
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
38 syn match asteriskVarLen "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=asteriskVar,asteriskVarLen,asteriskExp
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
39 syn match asteriskExp "\$\[.\{-}\]" contains=asteriskVar,asteriskVarLen,asteriskExp
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
40 syn match asteriskCodecsPermit "^\s*\(allow\|disallow\)\s*=\s*.*$" contains=asteriskCodecs
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
41 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
42 syn match asteriskError "^\(type\|auth\|permit\|deny\|bindaddr\|host\)\s*=.*$"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
43 syn match asteriskType "^\zstype=\ze\<\(peer\|user\|friend\)\>$" contains=asteriskTypeType
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
44 syn match asteriskTypeType "\<\(peer\|user\|friend\)\>" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
45 syn match asteriskAuth "^\zsauth\s*=\ze\s*\<\(md5\|rsa\|plaintext\)\>$" contains=asteriskAuthType
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
46 syn match asteriskAuthType "\<\(md5\|rsa\|plaintext\)\>"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
47 syn match asteriskAuth "^\zs\(secret\|inkeys\|outkey\)\s*=\ze.*$"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
48 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
49 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
50 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
51 syn match asteriskHostname "[[:alnum:]][[:alnum:]\-\.]*\.[[:alpha:]]{2,10}" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
52 syn match asteriskPort "\d\{1,5}" contained
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
53 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
54 syn match asteriskSetting "^port\s*=\s*\d\{1,5}\s*$" contains=asteriskPort
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
55 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
56
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
57 " Define the default highlighting.
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
58 " For version 5.7 and earlier: only when not done already
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
59 " For version 5.8 and later: only when an item doesn't have highlighting yet
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
60 if version >= 508 || !exists("did_conf_syntax_inits")
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
61 if version < 508
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
62 let did_conf_syntax_inits = 1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
63 command -nargs=+ HiLink hi link <args>
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
64 else
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
65 command -nargs=+ HiLink hi def link <args>
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
66 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
67
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
68 HiLink asteriskComment Comment
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
69 HiLink asteriskExten String
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
70 HiLink asteriskContext Preproc
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
71 HiLink asteriskPattern Type
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
72 HiLink asteriskApp Statement
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
73 HiLink asteriskInclude Preproc
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
74 HiLink asteriskIncludeBad Error
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
75 HiLink asteriskPriority Preproc
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
76 HiLink asteriskLabel Type
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
77 HiLink asteriskVar String
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
78 HiLink asteriskVarLen Function
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
79 HiLink asteriskExp Type
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
80 HiLink asteriskCodecsPermit Preproc
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
81 HiLink asteriskCodecs String
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
82 HiLink asteriskType Statement
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
83 HiLink asteriskTypeType Type
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
84 HiLink asteriskAuth String
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
85 HiLink asteriskAuthType Type
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
86 HiLink asteriskIPRange Identifier
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
87 HiLink asteriskIP Identifier
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
88 HiLink asteriskPort Identifier
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
89 HiLink asteriskHostname Identifier
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
90 HiLink asteriskSetting Statement
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
91 HiLink asteriskError Error
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
92 delcommand HiLink
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
93 endif
792
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
94 let b:current_syntax = "asterisk"
860b73800cd7 updated for version 7.0231
vimboss
parents: 531
diff changeset
95 " vim: ts=8 sw=2
531
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
96