]>
Commit | Line | Data |
---|---|---|
ff11ecc1 BB |
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 | ||
76926b3d | 10 | syn match moduleName '^[a-zA-Z0-9_.]\+\s*' nextgroup=dataType |
ff11ecc1 | 11 | |
7bd6f066 BB |
12 | syn match comment '\s*//\s*.*' |
13 | ||
ff11ecc1 BB |
14 | syn match classMembers '^\s\+\(\(<+\)\|\(<\~\)\|\(<-\)\|\(+>\)\|\(\~>\)\|\(->\)\|-\|+\|\(::\)\|#\)' nextgroup=memberName skipwhite |
15 | syn match internalOperators '\(\(<+\)\|\(<\~\)\|\(<-\)\|\(+>\)\|\(\~>\)\|\(->\)\|-\|+\|\(::\)\|#\)' contained nextgroup=memberName skipwhite | |
16 | syn match returnIdentifiers '\(=>\)' nextgroup=returnValue | |
17 | syn match returnIdentifiers '\(->\)' | |
18 | ||
19 | syn match memberName '\w\+' contained nextgroup=internalOperators,spacedDataType | |
20 | ||
21 | syn region parameterList start="(" end=")" transparent contains=parameters,separators,optionalParameter,dataType | |
22 | syn region optionalParameter start="\[" end="]" contains=optionalParameters contained | |
23 | syn region dataType start="<" end=">" contains=dataTypes,separators contained | |
24 | syn region spacedDataType start='\s\+<' end=">" contains=dataTypes,separators contained | |
25 | ||
26 | syn match optionalParameters '\w\+' contained | |
27 | syn match parameters '\w\+' contained | |
28 | syn match dataTypes '\w\+' contained | |
29 | syn match separators '|\|,' contained | |
30 | ||
31 | syn match returnValue '.*' contained contains=dataType,parameters | |
32 | ||
c810701f BB |
33 | " Nest JSON |
34 | syn include @JSON syntax/json.vim | |
35edebac | 35 | syn region jsonBlock start='```' end='```' contains=@JSON,comment,dataType |
ff11ecc1 BB |
36 | |
37 | hi def link moduleName Identifier | |
38 | ||
39 | hi def link classMembers Operator | |
40 | hi def link returnIdentifiers Operator | |
41 | hi def link internalOperators Operator | |
42 | ||
43 | hi def link memberName Special | |
44 | ||
45 | hi def link parameters PreProc | |
46 | hi def link optionalParameters Underlined | |
47 | hi def link dataTypes Constant | |
48 | ||
49 | hi def link separators Comment | |
7bd6f066 | 50 | hi def link comment Comment |
c810701f | 51 | hi def link jsonBlock Comment |