]> git.r.bdr.sh - rbdr/api-notation.vim/blob - syntax/api-notation.vim
d2fc97a6861b3b38a3873fcd18d860755666f8d4
[rbdr/api-notation.vim] / syntax / api-notation.vim
1 " Vim syntax file
2 " Language: API Notation
3 " Maintainer: Rubén Beltrán del Río
4 " Latest Revision: 22 June 2015
5
6 if exists("b:current_syntax")
7 finish
8 endif
9
10 syn match moduleName '^[\w\.]\+'
11
12 syn match classMembers '^\s\+\(\(<+\)\|\(<\~\)\|\(<-\)\|\(+>\)\|\(\~>\)\|\(->\)\|-\|+\|\(::\)\|#\)' nextgroup=memberName skipwhite
13 syn match internalOperators '\(\(<+\)\|\(<\~\)\|\(<-\)\|\(+>\)\|\(\~>\)\|\(->\)\|-\|+\|\(::\)\|#\)' contained nextgroup=memberName skipwhite
14 syn match returnIdentifiers '\(=>\)' nextgroup=returnValue
15 syn match returnIdentifiers '\(->\)'
16
17 syn match memberName '\w\+' contained nextgroup=internalOperators,spacedDataType
18
19 syn region parameterList start="(" end=")" transparent contains=parameters,separators,optionalParameter,dataType
20 syn region optionalParameter start="\[" end="]" contains=optionalParameters contained
21 syn region dataType start="<" end=">" contains=dataTypes,separators contained
22 syn region spacedDataType start='\s\+<' end=">" contains=dataTypes,separators contained
23
24 syn match optionalParameters '\w\+' contained
25 syn match parameters '\w\+' contained
26 syn match dataTypes '\w\+' contained
27 syn match separators '|\|,' contained
28
29 syn match returnValue '.*' contained contains=dataType,parameters
30
31
32 hi def link moduleName Identifier
33
34 hi def link classMembers Operator
35 hi def link returnIdentifiers Operator
36 hi def link internalOperators Operator
37
38 hi def link memberName Special
39
40 hi def link parameters PreProc
41 hi def link optionalParameters Underlined
42 hi def link dataTypes Constant
43
44 hi def link separators Comment