annotate runtime/syntax/gyp.vim @ 30547:1e91e26ceebf

Update runtime files Commit: https://github.com/vim/vim/commit/9fbdbb814f4ad67a14979aba4a6a49800c2f1a99 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 27 17:30:34 2022 +0100 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Tue, 27 Sep 2022 18:45:05 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30547
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: GYP
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: ObserverOfTime <chronobserver@disroot.org>
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Filenames: *.gyp,*.gypi
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " Last Change: 2022 Sep 27
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 if !exists('g:main_syntax')
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 if exists('b:current_syntax') && b:current_syntax ==# 'gyp'
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 finish
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 endif
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 let g:main_syntax = 'gyp'
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 endif
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 " Based on JSON syntax
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 runtime! syntax/json.vim
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 " Single quotes are allowed
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 syn clear jsonStringSQError
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 syn match jsonKeywordMatch /'\([^']\|\\\'\)\+'[[:blank:]\r\n]*\:/ contains=jsonKeyword
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 if has('conceal') && (!exists('g:vim_json_conceal') || g:vim_json_conceal==1)
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 syn region jsonKeyword matchgroup=jsonQuote start=/'/ end=/'\ze[[:blank:]\r\n]*\:/ concealends contained
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 else
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 syn region jsonKeyword matchgroup=jsonQuote start=/'/ end=/'\ze[[:blank:]\r\n]*\:/ contained
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 endif
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 syn match jsonStringMatch /'\([^']\|\\\'\)\+'\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 if has('conceal') && (!exists('g:vim_json_conceal') || g:vim_json_conceal==1)
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 syn region jsonString oneline matchgroup=jsonQuote start=/'/ skip=/\\\\\|\\'/ end=/'/ concealends contains=jsonEscape contained
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 else
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 syn region jsonString oneline matchgroup=jsonQuote start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=jsonEscape contained
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 endif
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 " Trailing commas are allowed
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 if !exists('g:vim_json_warnings') || g:vim_json_warnings==1
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 syn clear jsonTrailingCommaError
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 endif
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 " Python-style comments are allowed
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 syn match jsonComment /#.*$/ contains=jsonTodo,@Spell
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 syn keyword jsonTodo FIXME NOTE TODO XXX TBD contained
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 hi def link jsonComment Comment
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 hi def link jsonTodo Todo
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 let b:current_syntax = 'gyp'
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 if g:main_syntax ==# 'gyp'
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 unlet g:main_syntax
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 endif