Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>

[[ 🗃 ^yEzqv rel4tion-wiki ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/yEzqv

SSH: git clone USERNAME@vervis.peers.community:yEzqv

Branches

Tags

master :: grammar-notation /

sgn.vim

" Vim syntax file
" Language:         SGN
" Maintainer:       fr33domlover <fr33domlover@riseup.net>
" Last Change:      2015-03-30
" Roughly based on the EBNF syntax file by Hans Fugal.

" Bugs
" - Multi-line rules don't work

" Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

syn match   sgnNonTerminal /[a-zA-Z]/ skipwhite nextgroup=sgnSeparator
syn match   sgnSeparator   "=" contained skipwhite skipempty nextgroup=sgnProduction
syn match   sgnProduction  /.\+/ contained skipwhite skipempty contains=sgnOperator,sgnDelimiter,sgnTerminal,sgnExplanation,sgnComment,sgnRange,sgnOccurences,sgnUnicodeChar
syn region  sgnExplanation start=~/~ end=~/~ contained
syn region  sgnTerminal    start=/"/ end=/"/ contained
syn region  sgnTerminal    start=/'/ end=/'/ contained
syn match   sgnUnicodeChar /\\x[0-9a-fA-F]\+/ contained
syn region  sgnRange       start=/\[/ skip=/\\\]/ end=/\]/ contained
syn match   sgnOperator    /[|\-*+?!]/ contained
syn match   sgnOccurences  /#[0-9]\+\(-[0-9]\+\)\?/ contained
syn match   sgnDelimiter   /[()]/
syn keyword sgnTodo        TODO FIXME XXX contained
syn match   sgnComment     /--.*/ contains=sgnTodo

hi link     sgnExplanation Statement
hi link     sgnNonTerminal Identifier
hi link     sgnTerminal    String
hi link     sgnUnicodeChar SpecialChar
hi link     sgnRange       Constant
hi link     sgnOperator    Operator
hi link     sgnOccurences  Number
hi link     sgnDelimiter   Delimiter
hi link     sgnTodo        Todo
hi link     sgnComment     Comment

[See repo JSON]