Mercurial > vim
annotate runtime/syntax/dockerfile.vim @ 33070:8362975375a4 v9.0.1822
patch 9.0.1822: Vim9: no check for duplicate members in extended classes
Commit: https://github.com/vim/vim/commit/e3b6c78ddc4acf238af35d7fac585e7ead27392f
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue Aug 29 22:32:02 2023 +0200
patch 9.0.1822: Vim9: no check for duplicate members in extended classes
Problem: Vim9: no check for duplicate members in extended classes
Solution: Check for duplicate members in extended classes.
Fix memory leak.
closes: #12948
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 29 Aug 2023 22:45:03 +0200 |
parents | 7be3663e2f2b |
children | 0c191d9c6206 |
rev | line source |
---|---|
6180 | 1 " dockerfile.vim - Syntax highlighting for Dockerfiles |
9860
9eaf8ef656e9
commit https://github.com/vim/vim/commit/0952131376a517fc12dc5ae908a97018b4ee23f0
Christian Brabandt <cb@256bit.org>
parents:
6180
diff
changeset
|
2 " Maintainer: Honza Pokorny <https://honza.ca> |
19404 | 3 " Last Change: 2020 Feb 11 |
6180 | 4 " License: BSD |
5 | |
19303 | 6 " https://docs.docker.com/engine/reference/builder/ |
6180 | 7 |
8 if exists("b:current_syntax") | |
9 finish | |
10 endif | |
11 | |
19303 | 12 syntax include @JSON syntax/json.vim |
13 unlet b:current_syntax | |
14 | |
15 syntax include @Shell syntax/sh.vim | |
16 unlet b:current_syntax | |
6180 | 17 |
18 syntax case ignore | |
19303 | 19 syntax match dockerfileLinePrefix /\v^\s*(ONBUILD\s+)?\ze\S/ contains=dockerfileKeyword nextgroup=dockerfileInstruction skipwhite |
20 syntax region dockerfileFrom matchgroup=dockerfileKeyword start=/\v^\s*(FROM)\ze(\s|$)/ skip=/\v\\\_./ end=/\v((^|\s)AS(\s|$)|$)/ contains=dockerfileOption | |
6180 | 21 |
19303 | 22 syntax keyword dockerfileKeyword contained ADD ARG CMD COPY ENTRYPOINT ENV EXPOSE HEALTHCHECK LABEL MAINTAINER ONBUILD RUN SHELL STOPSIGNAL USER VOLUME WORKDIR |
23 syntax match dockerfileOption contained /\v(^|\s)\zs--\S+/ | |
6180 | 24 |
19404 | 25 syntax match dockerfileInstruction contained /\v<(\S+)>(\s+--\S+)*/ contains=dockerfileKeyword,dockerfileOption skipwhite nextgroup=dockerfileValue |
26 syntax match dockerfileInstruction contained /\v<(ADD|COPY)>(\s+--\S+)*/ contains=dockerfileKeyword,dockerfileOption skipwhite nextgroup=dockerfileJSON | |
27 syntax match dockerfileInstruction contained /\v<(HEALTHCHECK)>(\s+--\S+)*/ contains=dockerfileKeyword,dockerfileOption skipwhite nextgroup=dockerfileInstruction | |
28 syntax match dockerfileInstruction contained /\v<(CMD|ENTRYPOINT|RUN)>/ contains=dockerfileKeyword skipwhite nextgroup=dockerfileShell | |
29 syntax match dockerfileInstruction contained /\v<(CMD|ENTRYPOINT|RUN)>\ze\s+\[/ contains=dockerfileKeyword skipwhite nextgroup=dockerfileJSON | |
30 syntax match dockerfileInstruction contained /\v<(SHELL|VOLUME)>/ contains=dockerfileKeyword skipwhite nextgroup=dockerfileJSON | |
17758 | 31 |
19303 | 32 syntax region dockerfileString contained start=/\v"/ skip=/\v\\./ end=/\v"/ |
33 syntax region dockerfileJSON contained keepend start=/\v\[/ skip=/\v\\\_./ end=/\v$/ contains=@JSON | |
34 syntax region dockerfileShell contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=@Shell | |
35 syntax region dockerfileValue contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=dockerfileString | |
6180 | 36 |
19303 | 37 syntax region dockerfileComment start=/\v^\s*#/ end=/\v$/ |
38 set commentstring=#\ %s | |
6180 | 39 |
40 hi def link dockerfileString String | |
41 hi def link dockerfileKeyword Keyword | |
42 hi def link dockerfileComment Comment | |
19303 | 43 hi def link dockerfileOption Special |
44 | |
45 let b:current_syntax = "dockerfile" |