Page MenuHomePhabricator

Vim Syntaxic Coloration for demmt files
ActivePublic

Authored by pmoreau on Sep 30 2015, 11:36 AM.
" Vim Syntax File
" Language: Demmt
" Maintainer: Pierre Moreau <pierre.morrow@free.fr>
" Latest Revision: 22 February 2015
if exists("b:current_syntax")
finish
endif
syntax region demmtPart end='$' matchgroup=demmtPart start='\<LOG\>: ' keepend
syntax region demmtArgs end='$' matchgroup=demmtArgs start='\<LOG\>: \*\?\s\+'
syntax region demmtMsg start='\<MSG\>: ' end='$' contained containedin=demmtPart
syntax region demmtIoctl end='$' matchgroup=Structure start='\<NVRM_IOCTL\(_\u\(\u*\d*\)*\)\+\>' contained containedin=demmtPart
syntax cluster demmtCmd contains=demmtIoctl,demmtMthd,demmtArgs
syntax match demmtKey '\<\l\(_\?\l*\d*\)*\>' contained containedin=@demmtCmd
syntax match demmtName '\<\u\(_\?\u*\d*\)*\>:'he=e-1 contained containedin=@demmtCmd
syntax match demmtName2 '\<\a\(_\?\a*\d*\)*\>' contained containedin=demmtIndex
syntax region demmtIndex matchgroup=demmtIndex start='\[' end='\]' contained containedin=@demmtCmd
syntax match demmtNumber '\<\d\+\(\.\d\+\)\?\>' contained containedin=@demmtCmd,demmtIndex
syntax match demmtHexa '\<0x\x\+\>' contained containedin=@demmtCmd,demmtIndex
syntax match demmtFlag ': \<\u\(_\?\u*\d*\)*\>'hs=s+2 contained containedin=@demmtCmd
syntax match demmtPost '\<post\>' contained containedin=@demmtCmd
let b:current_syntax = "demmt"
highlight def link demmtNumber Number
highlight def link demmtHexa Number
highlight def link demmtFlag Tag
highlight def link demmtKey Label
highlight def link demmtName Structure
highlight def link demmtName2 Label
highlight def link demmtMsg Ignore
highlight def link demmtPost Delimiter

Event Timeline

pmoreau edited the content of this paste. (Show Details)Sep 30 2015, 11:36 AM
pmoreau changed the title of this paste from untitled to Vim Syntaxic Coloration for demmt files.
pmoreau updated the paste's language from autodetect to autodetect.
pmoreau changed the visibility from "All Users" to "Public (No Login Required)".
pmoreau added a project: Nouveau.