install_prereq: Download latest Jansson.
[asterisk/asterisk.git] / contrib / editors / ael.vim
1 " Vim syntax file
2 " Language:     Asterisk Extension Language
3 " Maintainer:   tilghman
4 " Last Change:  2009 Mar 04 
5 " version 0.1
6 "
7 if version < 600
8   syntax clear
9 elseif exists("b:current_syntax")
10   finish
11 endif
12
13 syn sync clear
14 syn sync fromstart
15
16 syn keyword     aelTodo            TODO contained
17 syn keyword     aelKeyword         context includes macro globals if else switch case default catch return switches includes for ignorepat
18 syn match       aelComment         "//.*" contains=aelTodo
19 syn match       aelContext         "\s+\zs[[:alpha:]][[:alnum:]\-_]*\ze\s*{"
20 " Macro declaration
21 syn match       aelMacro           "[[:alpha:]][[:alnum:]\-_]*(.\{-})\ze\s*{" contains=aelVar,aelFunction,aelExp,aelArgs
22 " Macro reference
23 syn match       aelMacro           "&[[:alpha:]][[:alnum:]\-_]*(.\{-});" contains=aelVar,aelFunction,aelExp,aelArgs
24 " Ranges or other pattern characters
25 syn match       aelExten           "\zs_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*\-]\)\+[\.!]\?\ze\s+=>"
26 syn match       aelExten           "\zs[[:alnum:]#*]\+\ze\s*=>"
27 syn match       aelApp             "\s\+\zs[[:alpha:]][[:alpha:]_]\+\ze[; ]"
28 syn match       aelApp             "\s\+\zs[[:alpha:]][[:alpha:]_]\+\ze(.\{-});"
29 syn match       aelLabel           "[[:alpha:]][[:alnum:]]*\ze:"
30 syn region      aelVar             matchgroup=aelVarStart start="\${" end="}" contains=aelVar,aelFunction,aelExp
31 syn match       aelVar             "\zs[[:alpha:]][[:alnum:]_]*\ze=" contains=aelVar,aelFunction,aelExp
32 " Retrieving the value of a function
33 syn match       aelFunction        "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.\{-})}" contains=aelVar,aelFunction,aelExp
34 " Setting a function
35 syn match       aelFunction        "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=aelVar,aelFunction,aelExp
36 syn region      aelExp             matchgroup=aelExpStart start="\$\[" end="]" contains=aelVar,aelFunction,aelExp
37 syn match       aelArgs            "([[:alnum:]_, ]*)" contains=aelArgsElement contained
38 syn match       aelArgsElement     "[[:alpha:]][[:alnum:]_]*" contained
39
40 " Define the default highlighting.
41 " For version 5.7 and earlier: only when not done already
42 " For version 5.8 and later: only when an item doesn't have highlighting yet
43 if version >= 508 || !exists("did_conf_syntax_inits")
44   if version < 508
45     let did_conf_syntax_inits = 1
46     command -nargs=+ HiLink hi link <args>
47   else
48     command -nargs=+ HiLink hi def link <args>
49   endif
50
51   HiLink        aelComment         Comment
52   HiLink        aelContext         Preproc
53   HiLink        aelMacro           Preproc
54   HiLink        aelExten           Type
55   HiLink        aelLabel           Type
56   HiLink        aelApp             Preproc
57   HiLink        aelVar             String
58   HiLink        aelVarStart        String
59   HiLink        aelArgsElement     String
60   HiLink        aelFunction        Function
61   HiLink        aelExp             Type
62   HiLink        aelExpStart        Type
63   HiLink        aelKeyword         Statement
64   HiLink        aelError           Error
65  delcommand HiLink
66 endif
67 let b:current_syntax = "ael" 
68 " vim: ts=8 sw=2
69