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