xref: /vim-8.2.3635/runtime/syntax/asterisk.vim (revision 4f4d51a9)
1bfd8fc05SBram Moolenaar" Vim syntax file
2bfd8fc05SBram Moolenaar" Language:	Asterisk config file
32b8388bdSBram Moolenaar" Maintainer: 	Jean Aunis <[email protected]>
42b8388bdSBram Moolenaar" Previous Maintainer:	brc007
5eee697b7SBram Moolenaar" Updated for 1.2 by Tilghman Lesher (Corydon76)
62b8388bdSBram Moolenaar" Last Change:	2015 Feb 27
7eee697b7SBram Moolenaar" version 0.4
889bcfda6SBram Moolenaar
989bcfda6SBram Moolenaar" quit when a syntax file was already loaded
1089bcfda6SBram Moolenaarif exists("b:current_syntax")
11bfd8fc05SBram Moolenaar  finish
12bfd8fc05SBram Moolenaarendif
13bfd8fc05SBram Moolenaar
14bfd8fc05SBram Moolenaarsyn sync clear
15bfd8fc05SBram Moolenaarsyn sync fromstart
16bfd8fc05SBram Moolenaar
17bfd8fc05SBram Moolenaarsyn keyword     asteriskTodo    TODO contained
18bfd8fc05SBram Moolenaarsyn match       asteriskComment         ";.*" contains=asteriskTodo
19bfd8fc05SBram Moolenaarsyn match       asteriskContext         "\[.\{-}\]"
202b8388bdSBram Moolenaarsyn match       asteriskExten           "^\s*\zsexten\s*=>\?\s*[^,]\+\ze," contains=asteriskPattern nextgroup=asteriskPriority
212b8388bdSBram Moolenaarsyn match       asteriskExten           "^\s*\zssame\s*=>\?\s*\ze" nextgroup=asteriskPriority
22*4f4d51a9SBram Moolenaarsyn match       asteriskExten           "^\s*\(register\|channel\|ignorepat\|include\|l\?e\?switch\|\(no\)\?load\)\s*=>\?"
23eee697b7SBram Moolenaarsyn match       asteriskPattern         "_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*]\)*\.\?" contained
24eee697b7SBram Moolenaarsyn match       asteriskPattern         "[^A-Za-z0-9,]\zs[[:alnum:]#*]\+\ze" contained
25eee697b7SBram Moolenaarsyn match       asteriskApp             ",\zs[a-zA-Z]\+\ze$"
26eee697b7SBram Moolenaarsyn match       asteriskApp             ",\zs[a-zA-Z]\+\ze("
27bfd8fc05SBram Moolenaar" Digits plus oldlabel (newlabel)
282b8388bdSBram Moolenaarsyn match       asteriskPriority        "\zs[[:digit:]]\+\(+[[:alpha:]][[:alnum:]_]*\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
29eee697b7SBram Moolenaar" oldlabel plus digits (newlabel)
302b8388bdSBram Moolenaarsyn match       asteriskPriority        "\zs[[:alpha:]][[:alnum:]_]*+[[:digit:]]\+\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
31bfd8fc05SBram Moolenaar" s or n plus digits (newlabel)
322b8388bdSBram Moolenaarsyn match       asteriskPriority        "\zs[sn]\(+[[:digit:]]\+\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?\ze," contains=asteriskLabel
33eee697b7SBram Moolenaarsyn match       asteriskLabel           "(\zs[[:alpha:]][[:alnum:]]*\ze)" contained
34eee697b7SBram Moolenaarsyn match       asteriskError           "^\s*#\s*[[:alnum:]]*"
35eee697b7SBram Moolenaarsyn match       asteriskInclude         "^\s*#\s*\(include\|exec\)\s.*"
36eee697b7SBram Moolenaarsyn match       asteriskVar             "\${_\{0,2}[[:alpha:]][[:alnum:]_]*\(:-\?[[:digit:]]\+\(:[[:digit:]]\+\)\?\)\?}"
37eee697b7SBram Moolenaarsyn match       asteriskVar             "_\{0,2}[[:alpha:]][[:alnum:]_]*\ze="
38eee697b7SBram Moolenaarsyn match       asteriskVarLen          "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.*)}" contains=asteriskVar,asteriskVarLen,asteriskExp
39eee697b7SBram Moolenaarsyn match       asteriskVarLen          "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=asteriskVar,asteriskVarLen,asteriskExp
40bfd8fc05SBram Moolenaarsyn match       asteriskExp             "\$\[.\{-}\]" contains=asteriskVar,asteriskVarLen,asteriskExp
41eee697b7SBram Moolenaarsyn match       asteriskCodecsPermit    "^\s*\(allow\|disallow\)\s*=\s*.*$" contains=asteriskCodecs
42*4f4d51a9SBram Moolenaarsyn match       asteriskCodecs          "\(vp9\|vp8\|h264\|h263p\|h263\|h261\|jpeg\|opus\|g722\|g723\|gsm\|ulaw\|alaw\|g719\|g726\|g726aal2\|siren7\|siren14\|adpcm\|slin\|lpc10\|g729\|speex\|ilbc\|wav\|all\s*$\)"
43eee697b7SBram Moolenaarsyn match       asteriskError           "^\(type\|auth\|permit\|deny\|bindaddr\|host\)\s*=.*$"
44eee697b7SBram Moolenaarsyn match       asteriskType            "^\zstype=\ze\<\(peer\|user\|friend\)\>$" contains=asteriskTypeType
45eee697b7SBram Moolenaarsyn match       asteriskTypeType        "\<\(peer\|user\|friend\)\>" contained
46eee697b7SBram Moolenaarsyn match       asteriskAuth            "^\zsauth\s*=\ze\s*\<\(md5\|rsa\|plaintext\)\>$" contains=asteriskAuthType
47eee697b7SBram Moolenaarsyn match       asteriskAuthType        "\<\(md5\|rsa\|plaintext\)\>"
48eee697b7SBram Moolenaarsyn match       asteriskAuth            "^\zs\(secret\|inkeys\|outkey\)\s*=\ze.*$"
49eee697b7SBram Moolenaarsyn 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
50eee697b7SBram Moolenaarsyn 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
51eee697b7SBram Moolenaarsyn match       asteriskIP              "\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}" contained
52eee697b7SBram Moolenaarsyn match       asteriskHostname        "[[:alnum:]][[:alnum:]\-\.]*\.[[:alpha:]]{2,10}" contained
53eee697b7SBram Moolenaarsyn match       asteriskPort            "\d\{1,5}" contained
54eee697b7SBram Moolenaarsyn match       asteriskSetting         "^bindaddr\s*=\s*\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}$" contains=asteriskIP
55eee697b7SBram Moolenaarsyn match       asteriskSetting         "^port\s*=\s*\d\{1,5}\s*$" contains=asteriskPort
56eee697b7SBram Moolenaarsyn 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
57bfd8fc05SBram Moolenaar
58bfd8fc05SBram Moolenaar" Define the default highlighting.
5989bcfda6SBram Moolenaar" Only when an item doesn't have highlighting yet
60bfd8fc05SBram Moolenaar
61f37506f6SBram Moolenaarhi def link        asteriskComment		Comment
62f37506f6SBram Moolenaarhi def link        asteriskExten		String
63f37506f6SBram Moolenaarhi def link        asteriskContext         Preproc
64f37506f6SBram Moolenaarhi def link        asteriskPattern         Type
65f37506f6SBram Moolenaarhi def link        asteriskApp             Statement
66f37506f6SBram Moolenaarhi def link        asteriskInclude         Preproc
67f37506f6SBram Moolenaarhi def link        asteriskIncludeBad	Error
68f37506f6SBram Moolenaarhi def link        asteriskPriority        Preproc
69f37506f6SBram Moolenaarhi def link        asteriskLabel           Type
70f37506f6SBram Moolenaarhi def link        asteriskVar             String
71f37506f6SBram Moolenaarhi def link        asteriskVarLen          Function
72f37506f6SBram Moolenaarhi def link        asteriskExp             Type
73f37506f6SBram Moolenaarhi def link        asteriskCodecsPermit    Preproc
74f37506f6SBram Moolenaarhi def link        asteriskCodecs          String
75f37506f6SBram Moolenaarhi def link        asteriskType            Statement
76f37506f6SBram Moolenaarhi def link        asteriskTypeType        Type
77f37506f6SBram Moolenaarhi def link        asteriskAuth            String
78f37506f6SBram Moolenaarhi def link        asteriskAuthType        Type
79f37506f6SBram Moolenaarhi def link        asteriskIPRange         Identifier
80f37506f6SBram Moolenaarhi def link        asteriskIP              Identifier
81f37506f6SBram Moolenaarhi def link        asteriskPort            Identifier
82f37506f6SBram Moolenaarhi def link        asteriskHostname        Identifier
83f37506f6SBram Moolenaarhi def link        asteriskSetting         Statement
84f37506f6SBram Moolenaarhi def link        asteriskError           Error
8589bcfda6SBram Moolenaar
86bfd8fc05SBram Moolenaarlet b:current_syntax = "asterisk"
87bfd8fc05SBram Moolenaar" vim: ts=8 sw=2
88eee697b7SBram Moolenaar
89