File: kpeg.vim

package info (click to toggle)
ruby-kpeg 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 608 kB
  • sloc: ruby: 11,839; makefile: 10
file content (55 lines) | stat: -rw-r--r-- 1,272 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
" Vim syntax file
" Language:   kpeg
" Version:      $Revision$

if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

syn case match

" Misc syntax.
syn match   kpegOperator /[|*?+!\[\]]/
syn match   kpegAssign "="
syn match   kpegCapture /[<>]/
syn match   kpegParen /[()]/

syn match   kpegIdentifier /-|([a-zA-Z][-a-zA-Z0-9]*)/
syn match   kpegComment /#.*$/
syn region  kpegString start="\"" end="\"" skip="\\\\\|\\\""
syn region  kpegRegexp start=/\// skip=/\\\// end=/\//

syntax include @Ruby syntax/ruby.vim

syn region  kpegCode   matchgroup=kpegCurly start=/{/ end=/}/ contains=@Ruby

syn match   kpegLabel /:[a-zA-Z][-a-zA-Z0-9]*/

if version >= 508 || !exists("did_c_syn_inits")
  if version < 508
    let did_c_syn_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  HiLink kpegRegexp Special
  HiLink kpegNumber Number
  HiLink kpegComment Comment
  HiLink kpegString String
  HiLink kpegLabel Type
  HiLink kpegOperator Operator
  HiLink kpegAssign Define
  HiLink kpegCapture Keyword
  HiLink kpegFloat Float
  HiLink kpegIdentifier Identifier

  HiLink kpegParen Delimiter
  HiLink kpegCurly Delimiter

  delcommand HiLink
endif

let b:current_syntax = "kpeg"