annotate runtime/syntax/asterisk.vim @ 706:ef3b59af4207

updated for version 7.0213
author vimboss
date Fri, 03 Mar 2006 22:50:42 +0000
parents da9142bd190a
children 860b73800cd7
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
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
3 " Maintainer: brc007
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
4 " Last Change: 2005 Sep 19
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
5 " version 0.2
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
6 "
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
7 " Additional changes made 2005 Mar 7 by Corydon76
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
8 " * CVS priority, including n and s, and new label definitions
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
9 " * ENV( and LEN( support
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
10 " * Class patterns in extensions now match only the class pattern (instead of to a following expression)
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
11 " * anthm's functions are matched
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
12 " * Variables now appear in their own colors inside expressions
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
13
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
14 " For version 5.x: Clear all syntax items
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
15 " For version 6.x: Quit when a syntax file was already loaded
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
16 if version < 600
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
17 syntax clear
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
18 elseif exists("b:current_syntax")
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
19 finish
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
20 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
21
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
22 "testing only
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
23 syn sync clear
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
24 syn sync fromstart
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
25
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
26
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
27 syn keyword asteriskTodo TODO contained
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
28 syn match asteriskComment ";.*" contains=asteriskTodo
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
29 syn match asteriskContext "\[.\{-}\]"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
30 syn match asteriskExten "^\s*exten\s*=>"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
31 syn match asteriskApp "\s*,\s*\zs[a-zA-Z]*\ze"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
32 " Digits plus oldlabel (newlabel)
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
33 syn match asteriskPriority ",[[:digit:]]\+\(+[[:alpha:]][[:alnum:]_]*\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?,"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
34 " s or n plus digits (newlabel)
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
35 syn match asteriskPriority ",[sn]\(+[[:digit:]]\+\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?,"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
36 syn match asteriskIncludeBad "^\s*#\s*[[:alnum:]]*"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
37 syn match asteriskInclude "^\s#\sinclude\s.*"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
38 syn match asteriskVar "\${_\{0,2}[[:alpha:]][[:alnum:]_]*\(:[[:digit:]]\+\)\{0,2}}"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
39 syn match asteriskVarLen "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.\{-})}" contains=asteriskVar,asteriskVarLen,asteriskExp
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
40 syn match asteriskExp "\$\[.\{-}\]" contains=asteriskVar,asteriskVarLen,asteriskExp
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
41 syn match asteriskFunc "\$([[:alpha:]][[:alnum:]_]*.*)" contains=asteriskVar,asteriskVarLen,asteriskExp
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
42
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
43 " Define the default highlighting.
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
44 " For version 5.7 and earlier: only when not done already
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
45 " For version 5.8 and later: only when an item doesn't have highlighting yet
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
46 :if version >= 508 || !exists("did_conf_syntax_inits")
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
47 if version < 508
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
48 let did_conf_syntax_inits = 1
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
49 command -nargs=+ HiLink hi link <args>
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
50 else
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
51 command -nargs=+ HiLink hi def link <args>
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
52 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
53
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
54
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
55 HiLink asteriskComment Comment
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
56 " not sure what type this should be, using String for testing.
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
57 HiLink asteriskExten String
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
58 " same here
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
59 HiLink asteriskContext Identifier
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
60 HiLink asteriskApplication Statement
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
61 HiLink asteriskInclude Preproc
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
62 HiLink asteriskIncludeBad Error
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
63 HiLink asteriskPriority Preproc
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
64 HiLink asteriskVar String
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
65 HiLink asteriskVarLen Function
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
66 HiLink asteriskExp Type
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
67 delcommand HiLink
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
68 endif
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
69
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
70
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
71 let b:current_syntax = "asterisk"
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
72
da9142bd190a updated for version 7.0149
vimboss
parents:
diff changeset
73 " vim: ts=8 sw=2