Browse Source

vim: change leg support to use submodule instead of import

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

+ 3
- 0
.gitmodules

@ -1,3 +1,6 @@
[submodule "3rd-party/cocci-syntax"] [submodule "3rd-party/cocci-syntax"]
path = 3rd-party/cocci-syntax path = 3rd-party/cocci-syntax
url = https://github.com/ahf/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

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

@ -0,0 +1 @@
Subproject commit acff328e93bd3961945fb5b484985af1447a8b59

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

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

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

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

+ 0
- 55
files/.vim/syntax/leg.vim

@ -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"

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

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

Loading…
Cancel
Save