diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-09-20 23:22:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-09-20 23:22:24 +0000 |
commit | bfd8fc0529f46612f7b3efca6c7b3305e70ac374 (patch) | |
tree | f6b8a9bdb8bf573cea7862b3ab5ad41dfb5d1b46 /runtime/syntax/asterisk.vim | |
parent | 60a795aad6ade281146a5343b416f21825af5364 (diff) | |
download | vim-git-bfd8fc0529f46612f7b3efca6c7b3305e70ac374.tar.gz |
updated for version 7.0149v7.0149
Diffstat (limited to 'runtime/syntax/asterisk.vim')
-rw-r--r-- | runtime/syntax/asterisk.vim | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/runtime/syntax/asterisk.vim b/runtime/syntax/asterisk.vim new file mode 100644 index 000000000..c4e2b15f4 --- /dev/null +++ b/runtime/syntax/asterisk.vim @@ -0,0 +1,73 @@ +" Vim syntax file +" Language: Asterisk config file +" Maintainer: brc007 +" Last Change: 2005 Sep 19 +" version 0.2 +" +" Additional changes made 2005 Mar 7 by Corydon76 +" * CVS priority, including n and s, and new label definitions +" * ENV( and LEN( support +" * Class patterns in extensions now match only the class pattern (instead of to a following expression) +" * anthm's functions are matched +" * Variables now appear in their own colors inside expressions + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +"testing only +syn sync clear +syn sync fromstart + + +syn keyword asteriskTodo TODO contained +syn match asteriskComment ";.*" contains=asteriskTodo +syn match asteriskContext "\[.\{-}\]" +syn match asteriskExten "^\s*exten\s*=>" +syn match asteriskApp "\s*,\s*\zs[a-zA-Z]*\ze" +" Digits plus oldlabel (newlabel) +syn match asteriskPriority ",[[:digit:]]\+\(+[[:alpha:]][[:alnum:]_]*\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?," +" s or n plus digits (newlabel) +syn match asteriskPriority ",[sn]\(+[[:digit:]]\+\)\?\(([[:alpha:]][[:alnum:]_]*)\)\?," +syn match asteriskIncludeBad "^\s*#\s*[[:alnum:]]*" +syn match asteriskInclude "^\s#\sinclude\s.*" +syn match asteriskVar "\${_\{0,2}[[:alpha:]][[:alnum:]_]*\(:[[:digit:]]\+\)\{0,2}}" +syn match asteriskVarLen "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.\{-})}" contains=asteriskVar,asteriskVarLen,asteriskExp +syn match asteriskExp "\$\[.\{-}\]" contains=asteriskVar,asteriskVarLen,asteriskExp +syn match asteriskFunc "\$([[:alpha:]][[:alnum:]_]*.*)" contains=asteriskVar,asteriskVarLen,asteriskExp + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +:if version >= 508 || !exists("did_conf_syntax_inits") + if version < 508 + let did_conf_syntax_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + + HiLink asteriskComment Comment +" not sure what type this should be, using String for testing. + HiLink asteriskExten String +" same here + HiLink asteriskContext Identifier + HiLink asteriskApplication Statement + HiLink asteriskInclude Preproc + HiLink asteriskIncludeBad Error + HiLink asteriskPriority Preproc + HiLink asteriskVar String + HiLink asteriskVarLen Function + HiLink asteriskExp Type + delcommand HiLink +endif + + +let b:current_syntax = "asterisk" + +" vim: ts=8 sw=2 |