From 3c65a7de7ad4fb7ff57a7231cca3a1f7d514f3c3 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Sat, 1 Aug 2020 23:54:25 +0100 Subject: [PATCH] vim: change leg support to use submodule instead of import Signed-off-by: Alejandro Mery --- .gitmodules | 3 ++ 3rd-party/leg.vim | 1 + files/.vim/ftdetect/leg.vim | 2 +- files/.vim/syntax/leg.vim | 56 +------------------------------------ 4 files changed, 6 insertions(+), 56 deletions(-) create mode 160000 3rd-party/leg.vim mode change 100644 => 120000 files/.vim/ftdetect/leg.vim mode change 100644 => 120000 files/.vim/syntax/leg.vim diff --git a/.gitmodules b/.gitmodules index 25dd96a..7911f3c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "3rd-party/cocci-syntax"] path = 3rd-party/cocci-syntax url = https://github.com/ahf/cocci-syntax +[submodule "3rd-party/leg.vim"] + path = 3rd-party/leg.vim + url = https://github.com/Qix-/leg.vim diff --git a/3rd-party/leg.vim b/3rd-party/leg.vim new file mode 160000 index 0000000..acff328 --- /dev/null +++ b/3rd-party/leg.vim @@ -0,0 +1 @@ +Subproject commit acff328e93bd3961945fb5b484985af1447a8b59 diff --git a/files/.vim/ftdetect/leg.vim b/files/.vim/ftdetect/leg.vim deleted file mode 100644 index dc5835e..0000000 --- a/files/.vim/ftdetect/leg.vim +++ /dev/null @@ -1 +0,0 @@ -au BufRead,BufNewFile *.leg set ft=leg diff --git a/files/.vim/ftdetect/leg.vim b/files/.vim/ftdetect/leg.vim new file mode 120000 index 0000000..c0a3b37 --- /dev/null +++ b/files/.vim/ftdetect/leg.vim @@ -0,0 +1 @@ +../../../3rd-party/leg.vim/ftdetect/leg.vim \ No newline at end of file diff --git a/files/.vim/syntax/leg.vim b/files/.vim/syntax/leg.vim deleted file mode 100644 index e9b23c9..0000000 --- a/files/.vim/syntax/leg.vim +++ /dev/null @@ -1,55 +0,0 @@ -" Vim syntax file -" Language: Parser Expression Grammars (PEG) -- LEG dialect -" Maintainer: Gianni Chiappetta, Josh Junon -" Latest Revision: 2016-10-06 - -if exists("b:current_syntax") - finish -endif - -syn include @c syntax/cpp.vim - -syn match legRuleIdentifier /^\v[-a-zA-Z_][-a-zA-Z_0-9]*/ skipwhite skipnl nextgroup=legSeperator - -syn match legSeperator "=" skipwhite skipnl contained nextgroup=legExpression - -syn match legExpression /\v[^\;]*/ contained skipwhite skipnl contains=legDelimiter,legOrderedChoice,legGrouping,legSpecial,legRange,legTerminal,legNonTerminal,legQuantifier,legRuleBody -syn match legDelimiter /[§]/ contained display -syn region legGrouping matchgroup=legDelimiter start=/(/ end=/)/ contained skipwhite keepend contains=legExpression display -syn match legSpecial /[!&ϵ^]/ contained display -syn match legOrderedChoice /\v\|/ display -syn region legRange matchgroup=legDelimiter start=/\[^/ start=/\[/ end=/\]/ contained skipwhite contains=legRangeValue,legUnicode display -syn match legRangeValue /\d\+-\d\+/ contained display -syn match legRangeValue /\a\+-\a\+/ contained display -syn region legTerminal matchgroup=legDelimiter start=/"/ end=/"/ contained display -syn region legTerminal matchgroup=legDelimiter start=/'/ end=/'/ contained display -syn match legUnicode /U+[A-F0-9]\{4,6}/ contained display -syn match legNonTerminal /\a+/ contained display -syn match legQuantifier /[+\*?]/ contained display -syn match legQuantifier /{\d\+,\d\+}/ contained display -syn match legQuantifier /{\d\+}/ contained display -syn match legSpecialSymbol /\v\$\$/ contained display -syn region legRuleBody matchgroup=legCDelimiter start=/\v([@~]\s*)?\{/ end=/}/ contains=legSpecialSymbol,@c - -syn match legComment /#.*$/ contains=legTodo -syn keyword legTodo TODO FIXME XXX NOTE contained - -syn region legCBlock matchgroup=legCDelimiter start=/\v^\%\{/ end=/\v\%\}$/ keepend contains=@c -syn region legCBlock matchgroup=legCDelimiter start=/\v\%\%/ skip=/\v.*/ end=/$/ excludenl contains=@c - -hi link legOrderedChoice legSeperator - -hi link legRuleIdentifier Statement -hi link legSeperator Conditional -hi link legDelimiter Delimiter -hi link legCDelimiter Conditional -hi link legSpecial Special -hi link legComment Comment -hi link legRangeValue Constant -hi link legTerminal String -hi link legUnicode Constant -hi link legQuantifier Function -hi link legTodo Todo -hi link legSpecialSymbol Special - -let b:current_syntax = "leg" diff --git a/files/.vim/syntax/leg.vim b/files/.vim/syntax/leg.vim new file mode 120000 index 0000000..23959bc --- /dev/null +++ b/files/.vim/syntax/leg.vim @@ -0,0 +1 @@ +../../../3rd-party/leg.vim/syntax/leg.vim \ No newline at end of file