robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
ab20681c52
master
1" Vim syntax file 2" Language: GYP 3" Maintainer: ObserverOfTime <chronobserver@disroot.org> 4" Filenames: *.gyp,*.gypi 5" Last Change: 2022 Sep 27 6 7if ! exists ( 'g:main_syntax' ) 8if exists ( 'b:current_syntax' ) && b: current_syntax ==# 'gyp' 9finish 10endif 11let g: main_syntax = 'gyp' 12endif 13 14" Based on JSON syntax 15runtime ! syntax/json.vim 16 17" Single quotes are allowed 18syn clear jsonStringSQError 19 20syn match jsonKeywordMatch /'\( [ ^' ] \|\\\'\)\+' [ [:blank: ] \r\n] * \: /contains = jsonKeyword 21if has ( 'conceal' ) && ( ! exists ( 'g:vim_json_conceal' ) || g: vim_json_conceal == 1 ) 22syn region jsonKeyword matchgroup = jsonQuote start = /' /end = /'\ze [ [:blank: ] \r\n] * \: /concealends contained 23else 24syn region jsonKeyword matchgroup = jsonQuote start = /' /end = /'\ze [ [:blank: ] \r\n] * \: /contained 25endif 26 27syn match jsonStringMatch /'\( [ ^' ] \|\\\'\)\+'\ze [ [:blank: ] \r\n] * [ ,}\] ] /contains = jsonString 28if has ( 'conceal' ) && ( ! exists ( 'g:vim_json_conceal' ) || g: vim_json_conceal == 1 ) 29syn region jsonString oneline matchgroup = jsonQuote start = /' /skip = /\\\\\|\\' /end = /' /concealends contains = jsonEscape contained 30else 31syn region jsonString oneline matchgroup = jsonQuote start = /' /skip = /\\\\\|\\' /end = /' /contains = jsonEscape contained 32endif 33 34" Trailing commas are allowed 35if ! exists ( 'g:vim_json_warnings' ) || g: vim_json_warnings == 1 36syn clear jsonTrailingCommaError 37endif 38 39" Python-style comments are allowed 40syn match jsonComment /#. * $ /contains = jsonTodo , @Spell 41syn keyword jsonTodo FIXME NOTE TODO XXX TBD contained 42 43hi def link jsonComment Comment 44hi def link jsonTodo Todo 45 46let b: current_syntax = 'gyp' 47if g: main_syntax ==# 'gyp' 48unlet g: main_syntax 49endif