annotate runtime/syntax/go.vim @ 34906:cb75f6489b63

runtime(go): fix highlighting import string followed by some comment (#14538) Commit: https://github.com/vim/vim/commit/122d068585686babd63f0b729759ec269171d464 Author: Linda_pp <rhysd@users.noreply.github.com> Date: Sun Apr 14 00:56:17 2024 +0900 runtime(go): fix highlighting import string followed by some comment (https://github.com/vim/vim/issues/14538) Signed-off-by: rhysd <lin90162@yahoo.co.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 13 Apr 2024 18:00:07 +0200
parents deee52c162df
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
1 " Copyright 2009 The Go Authors. All rights reserved.
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
2 " Use of this source code is governed by a BSD-style
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
3 " license that can be found in the LICENSE file.
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 "
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
5 " go.vim: Vim syntax file for Go.
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
6 " Language: Go
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
7 " Maintainer: Billie Cleek <bhcleek@gmail.com>
34906
cb75f6489b63 runtime(go): fix highlighting import string followed by some comment (#14538)
Christian Brabandt <cb@256bit.org>
parents: 34578
diff changeset
8 " Latest Revision: 2024-04-13
34578
deee52c162df runtime(go): `goPackageComment` highlighting too broad
Christian Brabandt <cb@256bit.org>
parents: 34172
diff changeset
9 " 2024-03-17: - fix goPackageComment highlight (by Vim Project)
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
10 " License: BSD-style. See LICENSE file in source repository.
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
11 " Repository: https://github.com/fatih/vim-go
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 " Quit when a (custom) syntax file was already loaded
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
14 if exists("b:current_syntax")
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 finish
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 endif
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
18 let s:keepcpo = &cpo
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
19 set cpo&vim
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
20
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
21 function! s:FoldEnable(...) abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
22 if a:0 > 0
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
23 return index(s:FoldEnable(), a:1) > -1
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
24 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
25 return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment'])
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
26 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
27
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
28 function! s:HighlightArrayWhitespaceError() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
29 return get(g:, 'go_highlight_array_whitespace_error', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
30 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
31
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
32 function! s:HighlightChanWhitespaceError() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
33 return get(g:, 'go_highlight_chan_whitespace_error', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
34 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
35
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
36 function! s:HighlightExtraTypes() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
37 return get(g:, 'go_highlight_extra_types', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
38 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
39
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
40 function! s:HighlightSpaceTabError() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
41 return get(g:, 'go_highlight_space_tab_error', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
42 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
43
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
44 function! s:HighlightTrailingWhitespaceError() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
45 return get(g:, 'go_highlight_trailing_whitespace_error', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
46 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
47
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
48 function! s:HighlightOperators() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
49 return get(g:, 'go_highlight_operators', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
50 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
51
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
52 function! s:HighlightFunctions() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
53 return get(g:, 'go_highlight_functions', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
54 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
55
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
56 function! s:HighlightFunctionParameters() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
57 return get(g:, 'go_highlight_function_parameters', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
58 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
59
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
60 function! s:HighlightFunctionCalls() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
61 return get(g:, 'go_highlight_function_calls', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
62 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
63
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
64 function! s:HighlightFields() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
65 return get(g:, 'go_highlight_fields', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
66 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
67
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
68 function! s:HighlightTypes() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
69 return get(g:, 'go_highlight_types', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
70 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
71
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
72 function! s:HighlightBuildConstraints() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
73 return get(g:, 'go_highlight_build_constraints', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
74 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
75
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
76 function! s:HighlightStringSpellcheck() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
77 return get(g:, 'go_highlight_string_spellcheck', 1)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
78 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
79
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
80 function! s:HighlightFormatStrings() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
81 return get(g:, 'go_highlight_format_strings', 1)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
82 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
83
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
84 function! s:HighlightGenerateTags() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
85 return get(g:, 'go_highlight_generate_tags', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
86 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
87
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
88 function! s:HighlightVariableAssignments() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
89 return get(g:, 'go_highlight_variable_assignments', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
90 endfunction
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
91
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
92 function! s:HighlightVariableDeclarations() abort
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
93 return get(g:, 'go_highlight_variable_declarations', 0)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
94 endfunction
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
95
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
96 syn case match
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
97
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
98 syn keyword goPackage package
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
99 syn keyword goImport import contained
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
100 syn keyword goVar var contained
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
101 syn keyword goConst const contained
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
102
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
103 hi def link goPackage Statement
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
104 hi def link goImport Statement
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
105 hi def link goVar Keyword
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
106 hi def link goConst Keyword
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
107 hi def link goDeclaration Keyword
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
108
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
109 " Keywords within functions
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
110 syn keyword goStatement defer go goto return break continue fallthrough
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
111 syn keyword goConditional if else switch select
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
112 syn keyword goLabel case default
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
113 syn keyword goRepeat for range
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
114
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
115 hi def link goStatement Statement
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
116 hi def link goConditional Conditional
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
117 hi def link goLabel Label
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
118 hi def link goRepeat Repeat
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
119
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
120 " Predefined types
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
121 syn keyword goType chan map bool string error any comparable
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
122 syn keyword goSignedInts int int8 int16 int32 int64 rune
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
123 syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
124 syn keyword goFloats float32 float64
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
125 syn keyword goComplexes complex64 complex128
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
126
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
127 hi def link goType Type
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
128 hi def link goSignedInts Type
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
129 hi def link goUnsignedInts Type
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
130 hi def link goFloats Type
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
131 hi def link goComplexes Type
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
132
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
133 " Predefined functions and values
32957
a5bd10de6c37 runtime(go): Update Go syntax file with 1.21 builtins (#12876)
Christian Brabandt <cb@256bit.org>
parents: 32004
diff changeset
134 syn keyword goBuiltins append cap clear close complex copy delete imag len
a5bd10de6c37 runtime(go): Update Go syntax file with 1.21 builtins (#12876)
Christian Brabandt <cb@256bit.org>
parents: 32004
diff changeset
135 syn keyword goBuiltins make max min new panic print println real recover
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
136 syn keyword goBoolean true false
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
137 syn keyword goPredefinedIdentifiers nil iota
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
138
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
139 hi def link goBuiltins Identifier
32004
a9b5ffbc0428 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 31139
diff changeset
140 hi def link goPredefinedIdentifiers Constant
a9b5ffbc0428 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 31139
diff changeset
141 " Boolean links to Constant by default by vim: goBoolean and goPredefinedIdentifiers
a9b5ffbc0428 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 31139
diff changeset
142 " will be highlighted the same, but having the separate groups allows users to
a9b5ffbc0428 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 31139
diff changeset
143 " have separate highlighting for them if they desire.
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
144 hi def link goBoolean Boolean
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
145
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
146 " Comments; their contents
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
147 syn keyword goTodo contained TODO FIXME XXX BUG
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
148 syn cluster goCommentGroup contains=goTodo
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
149
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
150 syn region goComment start="//" end="$" contains=goGenerate,@goCommentGroup,@Spell
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
151 if s:FoldEnable('comment')
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
152 syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell fold
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
153 syn match goComment "\v(^\s*//.*\n)+" contains=goGenerate,@goCommentGroup,@Spell fold
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
154 else
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
155 syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
156 endif
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
157
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
158 hi def link goComment Comment
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
159 hi def link goTodo Todo
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
160
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
161 if s:HighlightGenerateTags()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
162 syn match goGenerateVariables contained /\%(\$GOARCH\|\$GOOS\|\$GOFILE\|\$GOLINE\|\$GOPACKAGE\|\$DOLLAR\)\>/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
163 syn region goGenerate start="^\s*//go:generate" end="$" contains=goGenerateVariables
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
164 hi def link goGenerate PreProc
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
165 hi def link goGenerateVariables Special
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
166 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
167
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
168 " Go escapes
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
169 syn match goEscapeOctal display contained "\\[0-7]\{3}"
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
170 syn match goEscapeC display contained +\\[abfnrtv\\'"]+
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
171 syn match goEscapeX display contained "\\x\x\{2}"
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
172 syn match goEscapeU display contained "\\u\x\{4}"
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
173 syn match goEscapeBigU display contained "\\U\x\{8}"
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
174 syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
175
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
176 hi def link goEscapeOctal goSpecialString
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
177 hi def link goEscapeC goSpecialString
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
178 hi def link goEscapeX goSpecialString
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
179 hi def link goEscapeU goSpecialString
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
180 hi def link goEscapeBigU goSpecialString
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
181 hi def link goSpecialString Special
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
182 hi def link goEscapeError Error
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
183
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
184 " Strings and their contents
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
185 syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
186 if s:HighlightStringSpellcheck()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
187 syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup,@Spell
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
188 syn region goRawString start=+`+ end=+`+ contains=@Spell
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
189 else
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
190 syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
191 syn region goRawString start=+`+ end=+`+
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
192 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
193
34906
cb75f6489b63 runtime(go): fix highlighting import string followed by some comment (#14538)
Christian Brabandt <cb@256bit.org>
parents: 34578
diff changeset
194 syn match goImportString /^\%(\s\+\|import \)\(\h\w* \)\?\zs"[^"]\+"/ contained containedin=goImport
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
195
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
196 if s:HighlightFormatStrings()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
197 " [n] notation is valid for specifying explicit argument indexes
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
198 " 1. Match a literal % not preceded by a %.
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
199 " 2. Match any number of -, #, 0, space, or +
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
200 " 3. Match * or [n]* or any number or nothing before a .
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
201 " 4. Match * or [n]* or any number or nothing after a .
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
202 " 5. Match [n] or nothing before a verb
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
203 " 6. Match a formatting verb
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
204 syn match goFormatSpecifier /\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
205 \%([^%]\%(%%\)*\)\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
206 \@<=%[-#0 +]*\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
207 \%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
208 \%(\.\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\)\=\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
209 \%(\[\d\+\]\)\=[vTtbcdoqxXUeEfFgGspw]/ contained containedin=goString,goRawString
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
210 hi def link goFormatSpecifier goSpecialString
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
211 endif
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
212
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
213 hi def link goImportString String
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
214 hi def link goString String
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
215 hi def link goRawString String
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
216
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
217 " Characters; their contents
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
218 syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
219 syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
220
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
221 hi def link goCharacter Character
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
222
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
223 " Regions
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
224 syn region goParen start='(' end=')' transparent
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
225 if s:FoldEnable('block')
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
226 syn region goBlock start="{" end="}" transparent fold
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
227 else
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
228 syn region goBlock start="{" end="}" transparent
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
229 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
230
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
231 " import
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
232 if s:FoldEnable('import')
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
233 syn region goImport start='import (' end=')' transparent fold contains=goImport,goImportString,goComment
34172
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
234 syn match goImport /^import ()/ transparent fold contains=goImport
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
235 else
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
236 syn region goImport start='import (' end=')' transparent contains=goImport,goImportString,goComment
34172
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
237 syn match goImport /^import ()/ transparent contains=goImport
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
238 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
239
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
240 " var, const
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
241 if s:FoldEnable('varconst')
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
242 syn region goVar start='var (' end='^\s*)$' transparent fold
34172
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
243 \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
244 syn match goVar /var ()/ transparent fold
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
245 \ contains=goVar
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
246 syn region goConst start='const (' end='^\s*)$' transparent fold
34172
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
247 \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
248 syn match goConst /const ()/ transparent fold
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
249 \ contains=goConst
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
250 else
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
251 syn region goVar start='var (' end='^\s*)$' transparent
34172
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
252 \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
253 syn match goVar /var ()/ transparent
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
254 \ contains=goVar
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
255 syn region goConst start='const (' end='^\s*)$' transparent
34172
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
256 \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
257 syn match goConst /const ()/ transparent
176821d2ea8a runtime(go): update Go syntax file (#13896)
Christian Brabandt <cb@256bit.org>
parents: 32957
diff changeset
258 \ contains=goConst
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
259 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
260
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
261 " Single-line var, const, and import.
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
262 syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
263
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
264 " Integers
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
265 syn match goDecimalInt "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
266 syn match goHexadecimalInt "\<-\=0[xX]_\?\%(\x\|\x_\x\)\+\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
267 syn match goOctalInt "\<-\=0[oO]\?_\?\%(\o\|\o_\o\)\+\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
268 syn match goBinaryInt "\<-\=0[bB]_\?\%([01]\|[01]_[01]\)\+\>"
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
269
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
270 hi def link goDecimalInt Integer
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
271 hi def link goDecimalError Error
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
272 hi def link goHexadecimalInt Integer
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
273 hi def link goHexadecimalError Error
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
274 hi def link goOctalInt Integer
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
275 hi def link goOctalError Error
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
276 hi def link goBinaryInt Integer
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
277 hi def link goBinaryError Error
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
278 hi def link Integer Number
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
279
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
280 " Floating point
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
281 "float_lit = decimal_float_lit | hex_float_lit .
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
282 "
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
283 "decimal_float_lit = decimal_digits "." [ decimal_digits ] [ decimal_exponent ] |
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
284 " decimal_digits decimal_exponent |
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
285 " "." decimal_digits [ decimal_exponent ] .
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
286 "decimal_exponent = ( "e" | "E" ) [ "+" | "-" ] decimal_digits .
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
287 "
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
288 "hex_float_lit = "0" ( "x" | "X" ) hex_mantissa hex_exponent .
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
289 "hex_mantissa = [ "_" ] hex_digits "." [ hex_digits ] |
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
290 " [ "_" ] hex_digits |
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
291 " "." hex_digits .
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
292 "hex_exponent = ( "p" | "P" ) [ "+" | "-" ] decimal_digits .
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
293 " decimal floats with a decimal point
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
294 syn match goFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\.\%(\%(\%(\d\|\d_\d\)\+\)\=\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\=\>\)\="
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
295 syn match goFloat "\s\zs-\=\.\%(\d\|\d_\d\)\+\%(\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\>\)\="
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
296 " decimal floats without a decimal point
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
297 syn match goFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)[Ee][-+]\=\%(\d\|\d_\d\)\+\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
298 " hexadecimal floats with a decimal point
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
299 syn match goHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+\.\%(\%(\x\|\x_\x\)\+\)\=\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
300 syn match goHexadecimalFloat "\<-\=0[xX]\.\%(\x\|\x_\x\)\+\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
301 " hexadecimal floats without a decimal point
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
302 syn match goHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+[Pp][-+]\=\%(\d\|\d_\d\)\+\>"
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
303
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
304 hi def link goFloat Float
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
305 hi def link goHexadecimalFloat Float
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
306
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
307 " Imaginary literals
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
308 syn match goImaginaryDecimal "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)i\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
309 syn match goImaginaryHexadecimal "\<-\=0[xX]_\?\%(\x\|\x_\x\)\+i\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
310 syn match goImaginaryOctal "\<-\=0[oO]\?_\?\%(\o\|\o_\o\)\+i\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
311 syn match goImaginaryBinary "\<-\=0[bB]_\?\%([01]\|[01]_[01]\)\+i\>"
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
312
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
313 " imaginary decimal floats with a decimal point
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
314 syn match goImaginaryFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\.\%(\%(\%(\d\|\d_\d\)\+\)\=\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\=\)\=i\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
315 syn match goImaginaryFloat "\s\zs-\=\.\%(\d\|\d_\d\)\+\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\=i\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
316 " imaginary decimal floats without a decimal point
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
317 syn match goImaginaryFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)[Ee][-+]\=\%(\d\|\d_\d\)\+i\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
318 " imaginary hexadecimal floats with a decimal point
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
319 syn match goImaginaryHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+\.\%(\%(\x\|\x_\x\)\+\)\=\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=i\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
320 syn match goImaginaryHexadecimalFloat "\<-\=0[xX]\.\%(\x\|\x_\x\)\+\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=i\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
321 " imaginary hexadecimal floats without a decimal point
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
322 syn match goImaginaryHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+[Pp][-+]\=\%(\d\|\d_\d\)\+i\>"
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
323
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
324 hi def link goImaginaryDecimal Number
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
325 hi def link goImaginaryHexadecimal Number
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
326 hi def link goImaginaryOctal Number
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
327 hi def link goImaginaryBinary Number
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
328 hi def link goImaginaryFloat Float
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
329 hi def link goImaginaryHexadecimalFloat Float
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
330
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
331 " Spaces after "[]"
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
332 if s:HighlightArrayWhitespaceError()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
333 syn match goSpaceError display "\%(\[\]\)\@<=\s\+"
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
334 endif
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
335
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
336 " Spacing errors around the 'chan' keyword
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
337 if s:HighlightChanWhitespaceError()
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
338 " receive-only annotation on chan type
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
339 "
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
340 " \(\<chan\>\)\@<!<- (only pick arrow when it doesn't come after a chan)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
341 " this prevents picking up 'chan<- chan<-' but not '<- chan'
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
342 syn match goSpaceError display "\%(\%(\<chan\>\)\@<!<-\)\@<=\s\+\%(\<chan\>\)\@="
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
343
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
344 " send-only annotation on chan type
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
345 "
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
346 " \(<-\)\@<!\<chan\> (only pick chan when it doesn't come after an arrow)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
347 " this prevents picking up '<-chan <-chan' but not 'chan <-'
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
348 syn match goSpaceError display "\%(\%(<-\)\@<!\<chan\>\)\@<=\s\+\%(<-\)\@="
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
349
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
350 " value-ignoring receives in a few contexts
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
351 syn match goSpaceError display "\%(\%(^\|[={(,;]\)\s*<-\)\@<=\s\+"
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
352 endif
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
353
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
354 " Extra types commonly seen
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
355 if s:HighlightExtraTypes()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
356 syn match goExtraType /\<bytes\.\%(Buffer\)\>/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
357 syn match goExtraType /\<context\.\%(Context\)\>/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
358 syn match goExtraType /\<io\.\%(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
359 syn match goExtraType /\<reflect\.\%(Kind\|Type\|Value\)\>/
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
360 syn match goExtraType /\<unsafe\.Pointer\>/
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
361 endif
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
362
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
363 " Space-tab error
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
364 if s:HighlightSpaceTabError()
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
365 syn match goSpaceError display " \+\t"me=e-1
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
366 endif
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
367
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
368 " Trailing white space error
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
369 if s:HighlightTrailingWhitespaceError()
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
370 syn match goSpaceError display excludenl "\s\+$"
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
371 endif
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
372
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
373 hi def link goExtraType Type
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
374 hi def link goSpaceError Error
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
375
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
376
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
377
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
378 " included from: https://github.com/athom/more-colorful.vim/blob/master/after/syntax/go.vim
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
379 "
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
380 " Comments; their contents
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
381 syn keyword goTodo contained NOTE
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
382 hi def link goTodo Todo
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
383
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
384 syn match goVarArgs /\.\.\./
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
385
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
386 " Operators;
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
387 if s:HighlightOperators()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
388 " match single-char operators: - + % < > ! & | ^ * =
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
389 " and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= ==
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
390 syn match goOperator /[-+%<>!&|^*=]=\?/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
391 " match / and /=
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
392 syn match goOperator /\/\%(=\|\ze[^/*]\)/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
393 " match two-char operators: << >> &^
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
394 " and corresponding three-char operators: <<= >>= &^=
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
395 syn match goOperator /\%(<<\|>>\|&^\)=\?/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
396 " match remaining two-char operators: := && || <- ++ --
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
397 syn match goOperator /:=\|||\|<-\|++\|--/
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
398 " match ~
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
399 syn match goOperator /\~/
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
400 " match ...
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
401
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
402 hi def link goPointerOperator goOperator
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
403 hi def link goVarArgs goOperator
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
404 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
405 hi def link goOperator Operator
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
406
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
407 " -> type constraint opening bracket
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
408 " |-> start non-counting group
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
409 " || -> any word character
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
410 " || | -> at least one, as many as possible
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
411 " || | | -> start non-counting group
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
412 " || | | | -> match ~
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
413 " || | | | | -> at most once
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
414 " || | | | | | -> allow a slice type
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
415 " || | | | | | | -> any word character
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
416 " || | | | | | | | -> start a non-counting group
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
417 " || | | | | | | | | -> that matches word characters and |
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
418 " || | | | | | | | | | -> close the non-counting group
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
419 " || | | | | | | | | | | -> close the non-counting group
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
420 " || | | | | | | | | | | |-> any number of matches
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
421 " || | | | | | | | | | | || -> start a non-counting group
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
422 " || | | | | | | | | | | || | -> a comma and whitespace
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
423 " || | | | | | | | | | | || | | -> at most once
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
424 " || | | | | | | | | | | || | | | -> close the non-counting group
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
425 " || | | | | | | | | | | || | | | | -> at least one of those non-counting groups, as many as possible
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
426 " || | | | | | -------- | | | | || | | | | | -> type constraint closing bracket
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
427 " || | | | | || | | | | | || | | | | | |
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
428 syn match goTypeParams /\[\%(\w\+\s\+\%(\~\?\%(\[]\)\?\w\%(\w\||\)\)*\%(,\s*\)\?\)\+\]/ nextgroup=goSimpleParams,goDeclType contained
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
429
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
430 " Functions;
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
431 if s:HighlightFunctions() || s:HighlightFunctionParameters()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
432 syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleParams skipwhite skipnl
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
433 syn match goReceiverDecl /(\s*\zs\%(\%(\w\+\s\+\)\?\*\?\w\+\%(\[\%(\%(\[\]\)\?\w\+\%(,\s*\)\?\)\+\]\)\?\)\ze\s*)/ contained contains=goReceiverVar,goReceiverType,goPointerOperator
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
434 syn match goReceiverVar /\w\+\ze\s\+\%(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
435 syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
436 syn match goFunction /\w\+/ nextgroup=goSimpleParams,goTypeParams contained skipwhite skipnl
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
437 syn match goReceiverType /\w\+\%(\[\%(\%(\[\]\)\?\w\+\%(,\s*\)\?\)\+\]\)\?\ze\s*)/ contained
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
438 if s:HighlightFunctionParameters()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
439 syn match goSimpleParams /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType nextgroup=goFunctionReturn skipwhite skipnl
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
440 syn match goFunctionReturn /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType skipwhite skipnl
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
441 syn match goParamName /\w\+\%(\s*,\s*\w\+\)*\ze\s\+\%(\w\|\.\|\*\|\[\)/ contained nextgroup=goParamType skipwhite skipnl
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
442 syn match goParamType /\%([^,)]\|\_s\)\+,\?/ contained nextgroup=goParamName skipwhite skipnl
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
443 \ contains=goVarArgs,goType,goSignedInts,goUnsignedInts,goFloats,goComplexes,goDeclType,goBlock
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
444 hi def link goReceiverVar goParamName
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
445 hi def link goParamName Identifier
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
446 endif
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
447 syn match goReceiver /(\s*\%(\w\+\s\+\)\?\*\?\s*\w\+\%(\[\%(\%(\[\]\)\?\w\+\%(,\s*\)\?\)\+\]\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverDecl skipwhite skipnl
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
448 else
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
449 syn keyword goDeclaration func
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
450 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
451 hi def link goFunction Function
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
452
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
453 " Function calls;
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
454 if s:HighlightFunctionCalls()
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
455 syn match goFunctionCall /\w\+\ze\%(\[\%(\%(\[]\)\?\w\+\(,\s*\)\?\)\+\]\)\?(/ contains=goBuiltins,goDeclaration
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
456 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
457 hi def link goFunctionCall Type
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
458
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
459 " Fields;
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
460 if s:HighlightFields()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
461 " 1. Match a sequence of word characters coming after a '.'
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
462 " 2. Require the following but dont match it: ( \@= see :h E59)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
463 " - The symbols: / - + * % OR
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
464 " - The symbols: [] {} <> ) OR
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
465 " - The symbols: \n \r space OR
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
466 " - The symbols: , : .
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
467 " 3. Have the start of highlight (hs) be the start of matched
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
468 " pattern (s) offsetted one to the right (+1) (see :h E401)
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
469 syn match goField /\.\w\+\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
470 \%(\%([\/\-\+*%]\)\|\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
471 \%([\[\]{}<\>\)]\)\|\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
472 \%([\!=\^|&]\)\|\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
473 \%([\n\r\ ]\)\|\
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
474 \%([,\:.]\)\)\@=/hs=s+1
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
475 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
476 hi def link goField Identifier
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
477
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
478 " Structs & Interfaces;
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
479 if s:HighlightTypes()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
480 syn match goTypeConstructor /\<\w\+{\@=/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
481 syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
482 syn match goTypeName /\w\+/ contained nextgroup=goDeclType,goTypeParams skipwhite skipnl
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
483 syn match goDeclType /\<\%(interface\|struct\)\>/ skipwhite skipnl
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
484 hi def link goReceiverType Type
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
485 else
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
486 syn keyword goDeclType struct interface
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
487 syn keyword goDeclaration type
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
488 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
489 hi def link goTypeConstructor Type
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
490 hi def link goTypeName Type
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
491 hi def link goTypeDecl Keyword
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
492 hi def link goDeclType Keyword
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
493
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
494 " Variable Assignments
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
495 if s:HighlightVariableAssignments()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
496 syn match goVarAssign /\v[_.[:alnum:]]+(,\s*[_.[:alnum:]]+)*\ze(\s*([-^+|^\/%&]|\*|\<\<|\>\>|\&\^)?\=[^=])/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
497 hi def link goVarAssign Special
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
498 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
499
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
500 " Variable Declarations
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
501 if s:HighlightVariableDeclarations()
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
502 syn match goVarDefs /\v\w+(,\s*\w+)*\ze(\s*:\=)/
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
503 hi def link goVarDefs Special
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
504 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
505
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
506 " Build Constraints
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
507 if s:HighlightBuildConstraints()
25836
65de67669df3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25161
diff changeset
508 syn match goBuildKeyword display contained "+build\|go:build"
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
509 " Highlight the known values of GOOS, GOARCH, and other +build options.
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
510 syn keyword goBuildDirectives contained
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
511 \ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
512 \ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
513 \ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
514 \ s390 s390x sparc sparc64 cgo ignore race
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
515
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
516 " Other words in the build directive are build tags not listed above, so
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
517 " avoid highlighting them as comments by using a matchgroup just for the
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
518 " start of the comment.
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
519 " The rs=s+2 option lets the \s*+build portion be part of the inner region
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
520 " instead of the matchgroup so it will be highlighted as a goBuildKeyword.
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
521 syn region goBuildComment matchgroup=goBuildCommentStart
31139
20cf2080f1ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25836
diff changeset
522 \ start="//\(\s*+build\s\|go:build\)"rs=s+2 end="$"
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
523 \ contains=goBuildKeyword,goBuildDirectives
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
524 hi def link goBuildCommentStart Comment
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
525 hi def link goBuildDirectives Type
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
526 hi def link goBuildKeyword PreProc
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
527 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
528
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
529 if s:HighlightBuildConstraints() || s:FoldEnable('package_comment')
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
530 " One or more line comments that are followed immediately by a "package"
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
531 " declaration are treated like package documentation, so these must be
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
532 " matched as comments to avoid looking like working build constraints.
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
533 " The he, me, and re options let the "package" itself be highlighted by
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
534 " the usual rules.
34578
deee52c162df runtime(go): `goPackageComment` highlighting too broad
Christian Brabandt <cb@256bit.org>
parents: 34172
diff changeset
535 exe 'syn region goPackageComment start=/\v(\/\/.*\n)+\s*package\s/'
deee52c162df runtime(go): `goPackageComment` highlighting too broad
Christian Brabandt <cb@256bit.org>
parents: 34172
diff changeset
536 \ . ' end=/\v\n\s*package\s/he=e-8,me=e-8,re=e-8'
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
537 \ . ' contains=@goCommentGroup,@Spell'
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
538 \ . (s:FoldEnable('package_comment') ? ' fold' : '')
34578
deee52c162df runtime(go): `goPackageComment` highlighting too broad
Christian Brabandt <cb@256bit.org>
parents: 34172
diff changeset
539 exe 'syn region goPackageComment start=/\v^\s*\/\*.*\n(.*\n)*\s*\*\/\npackage\s/'
deee52c162df runtime(go): `goPackageComment` highlighting too broad
Christian Brabandt <cb@256bit.org>
parents: 34172
diff changeset
540 \ . ' end=/\v\*\/\n\s*package\s/he=e-8,me=e-8,re=e-8'
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
541 \ . ' contains=@goCommentGroup,@Spell'
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
542 \ . (s:FoldEnable('package_comment') ? ' fold' : '')
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
543 hi def link goPackageComment Comment
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
544 endif
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
545
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
546 " :GoCoverage commands
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
547 hi def link goCoverageNormalText Comment
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
548
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
549 " Search backwards for a global declaration to start processing the syntax.
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
550 "syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
551
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
552 " There's a bug in the implementation of grouphere. For now, use the
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
553 " following as a more expensive/less precise workaround.
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
554 syn sync minlines=500
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
555
25161
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
556 let b:current_syntax = "go"
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
557
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
558 let &cpo = s:keepcpo
84c7dc0fdcd2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 6153
diff changeset
559 unlet s:keepcpo
6153
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
560
1e8ebf870720 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
561 " vim: sw=2 sts=2 et