From 62fabf8835ae8bc5d37129d1eb8a420103e0ba0f Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Sun, 2 Aug 2020 01:38:28 +0100 Subject: [PATCH] vim: change peg support to use submodule instead of import Signed-off-by: Alejandro Mery --- .gitmodules | 3 +++ 3rd-party/peg.vim | 1 + files/.vim/ftdetect/peg.vim | 2 +- files/.vim/syntax/peg.vim | 48 +------------------------------------ 4 files changed, 6 insertions(+), 48 deletions(-) create mode 160000 3rd-party/peg.vim mode change 100644 => 120000 files/.vim/ftdetect/peg.vim mode change 100644 => 120000 files/.vim/syntax/peg.vim diff --git a/.gitmodules b/.gitmodules index 7911f3c..fedff21 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "3rd-party/leg.vim"] path = 3rd-party/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 diff --git a/3rd-party/peg.vim b/3rd-party/peg.vim new file mode 160000 index 0000000..4422957 --- /dev/null +++ b/3rd-party/peg.vim @@ -0,0 +1 @@ +Subproject commit 442295703190e5c8fe2fe2389814f25cac92269a diff --git a/files/.vim/ftdetect/peg.vim b/files/.vim/ftdetect/peg.vim deleted file mode 100644 index 01bc5a0..0000000 --- a/files/.vim/ftdetect/peg.vim +++ /dev/null @@ -1 +0,0 @@ -au BufRead,BufNewFile *.peg set ft=peg diff --git a/files/.vim/ftdetect/peg.vim b/files/.vim/ftdetect/peg.vim new file mode 120000 index 0000000..f3209c1 --- /dev/null +++ b/files/.vim/ftdetect/peg.vim @@ -0,0 +1 @@ +../../../3rd-party/peg.vim/ftdetect/peg.vim \ No newline at end of file diff --git a/files/.vim/syntax/peg.vim b/files/.vim/syntax/peg.vim deleted file mode 100644 index c2a8723..0000000 --- a/files/.vim/syntax/peg.vim +++ /dev/null @@ -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" - diff --git a/files/.vim/syntax/peg.vim b/files/.vim/syntax/peg.vim new file mode 120000 index 0000000..a709cbb --- /dev/null +++ b/files/.vim/syntax/peg.vim @@ -0,0 +1 @@ +../../../3rd-party/peg.vim/syntax/peg.vim \ No newline at end of file