Vim syntax file for demo.srd
This commit is contained in:
parent
b6738aff95
commit
7e5b69e714
2 changed files with 127 additions and 0 deletions
125
.vim.local/syntax/demo-srd.vim
Normal file
125
.vim.local/syntax/demo-srd.vim
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
if exists( "b:current_syntax" )
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
syn iskeyword @,-,$
|
||||||
|
syn sync lines=100
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------
|
||||||
|
" Clusters
|
||||||
|
|
||||||
|
syn cluster srdListCluster contains=@srdListCluster,srdKWDefAsset,srdKWDebug,srdKWFlow,srdKWState,srdKWDraw,srdKWExpr,srdWord,srdVariable,srdSLComment,srdMLComment,srdString,srdNumeric,srdBinary
|
||||||
|
syn cluster srdCommentCluster contains=@srdCommentCluster,srdTodo
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------
|
||||||
|
" Lists
|
||||||
|
|
||||||
|
syn region srdList0 matchgroup=hlLevel0 start="(" end=")" contains=@srdListCluster,srdList1
|
||||||
|
syn region srdList1 matchgroup=hlLevel1 start="(" end=")" contains=@srdListCluster,srdList2
|
||||||
|
syn region srdList2 matchgroup=hlLevel2 start="(" end=")" contains=@srdListCluster,srdList3
|
||||||
|
syn region srdList3 matchgroup=hlLevel3 start="(" end=")" contains=@srdListCluster,srdList4
|
||||||
|
syn region srdList4 matchgroup=hlLevel4 start="(" end=")" contains=@srdListCluster,srdList5
|
||||||
|
syn region srdList5 matchgroup=hlLevel5 start="(" end=")" contains=@srdListCluster,srdList6
|
||||||
|
syn region srdList6 matchgroup=hlLevel6 start="(" end=")" contains=@srdListCluster,srdList7
|
||||||
|
syn region srdList7 matchgroup=hlLevel7 start="(" end=")" contains=@srdListCluster,srdList8
|
||||||
|
syn region srdList8 matchgroup=hlLevel8 start="(" end=")" contains=@srdListCluster,srdList9
|
||||||
|
syn region srdList9 matchgroup=hlLevel9 start="(" end=")" contains=@srdListCluster,srdList0
|
||||||
|
|
||||||
|
syn match srdListError ")"
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------
|
||||||
|
" Comments
|
||||||
|
|
||||||
|
syn match srdSLComment "#.*$" contains=srdTodo
|
||||||
|
syn region srdMLComment start="{" end="}" contains=srdMLComment,@srdCommentCluster
|
||||||
|
syn keyword srdTodo contained TODO TODO: FIXME FIXME: XXX XXX:
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------
|
||||||
|
" Keywords
|
||||||
|
|
||||||
|
syn keyword srdKWFlow if set call fn init frame
|
||||||
|
|
||||||
|
syn keyword srdKWDefAsset program pipeline input framebuffer texture sampler
|
||||||
|
|
||||||
|
syn keyword srdKWDebug profiling odbg ui-overrides
|
||||||
|
|
||||||
|
syn keyword srdKWState use-texture use-framebuffer use-program use-pipeline
|
||||||
|
syn keyword srdKWState uniforms uniforms-i viewport
|
||||||
|
|
||||||
|
syn keyword srdKWDraw fullscreen
|
||||||
|
|
||||||
|
syn keyword srdKWExpr add sub mul div pow
|
||||||
|
syn keyword srdKWExpr cmp-eq cmp-ne cmp-gt cmp-ge cmp-lt cmp-le
|
||||||
|
syn keyword srdKWExpr inv neg not sin cos tan sqrt ln exp
|
||||||
|
syn keyword srdKWExpr get-input
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------
|
||||||
|
" Variables, words and numbers
|
||||||
|
|
||||||
|
syn match srdVariable "\$[a-zA-Z][a-zA-Z0-9]*\(-[a-zA-Z][a-zA-Z0-9]*\)*"
|
||||||
|
syn match srdWord "-\?[a-zA-Z][a-zA-Z0-9]*\(-[a-zA-Z][a-zA-Z0-9]*\)*"
|
||||||
|
syn match srdNumeric "-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\([eE][-+]\=\d\+\)\="
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------
|
||||||
|
" Strings
|
||||||
|
|
||||||
|
syn match srdBadString +"[^"]*$+
|
||||||
|
syn region srdString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=srdStringEscape extend
|
||||||
|
syn match srdStringEscape display contained "\\[nbrt\\\"]"
|
||||||
|
syn match srdStringEscape display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------
|
||||||
|
" Binary data
|
||||||
|
|
||||||
|
syn region srdBinary start="\[" end="\]" contains=srdBinaryDigits,srdBinaryError
|
||||||
|
syn match srdBinaryDigits contained "[0-9a-fA-F][0-9a-fA-F]"
|
||||||
|
syn match srdBinaryError contained "[^0-9a-fA-F\ \t\[\]]"
|
||||||
|
syn match srdBinaryError contained "[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]\+"
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------------------
|
||||||
|
" Actual highlighting
|
||||||
|
|
||||||
|
hi def link srdSLComment Comment
|
||||||
|
hi def link srdMLComment Comment
|
||||||
|
hi def link srdTodo Todo
|
||||||
|
|
||||||
|
hi def link srdWord Identifier
|
||||||
|
|
||||||
|
hi def srdVariable ctermfg=121 cterm=italic
|
||||||
|
hi def srdNumeric cterm=italic ctermfg=10
|
||||||
|
hi def srdKWExpr ctermfg=39 cterm=italic
|
||||||
|
|
||||||
|
hi def link srdKWFlow Statement
|
||||||
|
hi def srdKWDefAsset ctermfg=83 cterm=bold
|
||||||
|
hi def srdKWDebug ctermfg=127 cterm=bold
|
||||||
|
hi def srdKWState ctermfg=180 cterm=bold
|
||||||
|
hi def srdKWDraw ctermfg=210 cterm=bold
|
||||||
|
|
||||||
|
hi def link srdBinary Number
|
||||||
|
hi def link srdBinaryDigits Number
|
||||||
|
hi def link srdBinaryError Error
|
||||||
|
|
||||||
|
hi def link srdString String
|
||||||
|
hi def link srdStringEscape SpecialChar
|
||||||
|
|
||||||
|
hi def hlLevel0 ctermfg=red guifg=red1
|
||||||
|
hi def hlLevel1 ctermfg=yellow guifg=orange1
|
||||||
|
hi def hlLevel2 ctermfg=green guifg=yellow1
|
||||||
|
hi def hlLevel3 ctermfg=cyan guifg=greenyellow
|
||||||
|
hi def hlLevel4 ctermfg=magenta guifg=green1
|
||||||
|
if &t_Co == 256
|
||||||
|
hi def hlLevel5 ctermfg=lightred guifg=springgreen1
|
||||||
|
hi def hlLevel6 ctermfg=lightyellow guifg=cyan1
|
||||||
|
hi def hlLevel7 ctermfg=lightgreen guifg=slateblue1
|
||||||
|
hi def hlLevel8 ctermfg=lightblue guifg=magenta1
|
||||||
|
hi def hlLevel9 ctermfg=lightcyan guifg=purple1
|
||||||
|
else
|
||||||
|
hi def hlLevel5 ctermfg=red guifg=springgreen1
|
||||||
|
hi def hlLevel6 ctermfg=yellow guifg=cyan1
|
||||||
|
hi def hlLevel7 ctermfg=green guifg=slateblue1
|
||||||
|
hi def hlLevel8 ctermfg=cyan guifg=magenta1
|
||||||
|
hi def hlLevel9 ctermfg=magenta guifg=purple1
|
||||||
|
endif
|
||||||
|
hi def link srdListError Error
|
||||||
|
|
||||||
|
|
||||||
|
let b:current_syntax="demo-srd"
|
2
demo.srd
2
demo.srd
|
@ -165,3 +165,5 @@
|
||||||
(fullscreen)
|
(fullscreen)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# vim: syntax=demo-srd
|
||||||
|
|
Loading…
Reference in a new issue