ebnf:doc: add syntax file for vim
Signed-off-by: Alejandro Mery <amery@geeks.cl>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
" Vim syntax file
|
||||
" Language: EBNF
|
||||
" Maintainer: Hans Fugal
|
||||
" Last Change: $Date: 2003/01/28 14:42:09 $
|
||||
" Version: $Id: ebnf.vim,v 1.1 2003/01/28 14:42:09 fugalh Exp $
|
||||
" With thanks to Michael Brailsford for the BNF syntax file.
|
||||
|
||||
" Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match ebnfMetaIdentifier /[A-Za-z]/ skipwhite skipempty nextgroup=ebnfSeperator
|
||||
|
||||
syn match ebnfSeperator "=" contained nextgroup=ebnfProduction skipwhite skipempty
|
||||
|
||||
syn region ebnfProduction start=/\zs[^\.;]/ end=/[\.;]/me=e-1 contained contains=ebnfSpecial,ebnfDelimiter,ebnfTerminal,ebnfSpecialSequence,ebnfComment nextgroup=ebnfEndProduction skipwhite skipempty
|
||||
syn match ebnfDelimiter #[,(|)\]}\[{/!]\|\(\*)\)\|\((\*\)\|\(/)\)\|\(:)\)\|\((/\)\|\((:\)# contained
|
||||
syn match ebnfSpecial /[\-\*]/ contained
|
||||
syn region ebnfSpecialSequence matchgroup=Delimiter start=/?/ end=/?/ contained
|
||||
syn match ebnfEndProduction /[\.;]/ contained
|
||||
syn region ebnfTerminal matchgroup=delimiter start=/"/ end=/"/ contained
|
||||
syn region ebnfTerminal matchgroup=delimiter start=/'/ end=/'/ contained
|
||||
syn region ebnfComment start="(\*" end="\*)"
|
||||
|
||||
|
||||
hi link ebnfComment Comment
|
||||
hi link ebnfMetaIdentifier Identifier
|
||||
hi link ebnfSeperator ebnfSpecial
|
||||
hi link ebnfEndProduction ebnfDelimiter
|
||||
hi link ebnfDelimiter Delimiter
|
||||
hi link ebnfSpecial Special
|
||||
hi link ebnfSpecialSequence Statement
|
||||
hi link ebnfTerminal Constant
|
||||
Reference in New Issue
Block a user