Browse Source

vim: change peg support to use submodule instead of import

Signed-off-by: Alejandro Mery <amery@geeks.cl>
master
Alejandro Mery 4 years ago
parent
commit
62fabf8835
4 changed files with 6 additions and 48 deletions
  1. +3
    -0
      .gitmodules
  2. +1
    -0
      3rd-party/peg.vim
  3. +0
    -1
      files/.vim/ftdetect/peg.vim
  4. +1
    -0
      files/.vim/ftdetect/peg.vim
  5. +0
    -47
      files/.vim/syntax/peg.vim
  6. +1
    -0
      files/.vim/syntax/peg.vim

+ 3
- 0
.gitmodules

@ -4,3 +4,6 @@
[submodule "3rd-party/leg.vim"] [submodule "3rd-party/leg.vim"]
path = 3rd-party/leg.vim path = 3rd-party/leg.vim
url = https://github.com/Qix-/leg.vim url = https://github.com/Qix-/leg.vim
[submodule "3rd-party/peg.vim"]
path = 3rd-party/peg.vim
url = https://github.com/gf3/peg.vim

+ 1
- 0
3rd-party/peg.vim

@ -0,0 +1 @@
Subproject commit 442295703190e5c8fe2fe2389814f25cac92269a

+ 0
- 1
files/.vim/ftdetect/peg.vim

@ -1 +0,0 @@
au BufRead,BufNewFile *.peg set ft=peg

+ 1
- 0
files/.vim/ftdetect/peg.vim

@ -0,0 +1 @@
../../../3rd-party/peg.vim/ftdetect/peg.vim

+ 0
- 47
files/.vim/syntax/peg.vim

@ -1,47 +0,0 @@
" Vim syntax file
" Language: Parser Expression Grammars (PEG)
" Maintainer: Gianni Chiappetta
" Latest Revision: 2011-02-08
if exists("b:current_syntax")
finish
endif
syn match pegRuleIdentifier /^\a\+/ skipwhite nextgroup=pegSeperator
syn match pegSeperator "<-" skipwhite contained nextgroup=pegExpression
syn match pegSeperator "←" skipwhite contained nextgroup=pegExpression
syn match pegExpression /.*/ contained skipwhite contains=pegDelimiter,pegGrouping,pegSpecial,pegRange,pegTerminal,pegOrderedChoice,pegNonTerminal,pegQuantifier
syn match pegDelimiter /[§]/ contained display
syn region pegGrouping matchgroup=pegDelimiter start=/(/ end=/)/ contained skipwhite keepend contains=pegExpression display
syn match pegSpecial /[!&ϵ^]/ contained display
syn match pegOrderedChoice /\// contained display
syn region pegRange matchgroup=pegDelimiter start=/\[^/ start=/\[/ end=/\]/ contained skipwhite contains=pegRangeValue,pegUnicode display
syn match pegRangeValue /\d\+-\d\+/ contained display
syn match pegRangeValue /\a\+-\a\+/ contained display
syn region pegTerminal matchgroup=pegDelimiter start=/"/ end=/"/ contained display
syn region pegTerminal matchgroup=pegDelimiter start=/'/ end=/'/ contained display
syn match pegUnicode /U+[A-F0-9]\{4,6}/ contained display
syn match pegNonTerminal /\a+/ contained display
syn match pegQuantifier /[+\*?]/ contained display
syn match pegQuantifier /{\d\+,\d\+}/ contained display
syn match pegQuantifier /{\d\+}/ contained display
syn match pegComment /;.*$/ contains=pegTodo
syn keyword pegTodo TODO FIXME XXX NOTE contained
hi link pegRuleIdentifier Identifier
hi link pegSeperator Conditional
hi link pegDelimiter Delimiter
hi link pegSpecial Special
hi link pegOrderedChoice Conditional
hi link pegComment Comment
hi link pegRangeValue Constant
hi link pegTerminal String
hi link pegUnicode Constant
hi link pegQuantifier Function
hi link pegTodo Todo
let b:current_syntax = "peg"

+ 1
- 0
files/.vim/syntax/peg.vim

@ -0,0 +1 @@
../../../3rd-party/peg.vim/syntax/peg.vim

Loading…
Cancel
Save