annotate runtime/syntax/elmfilt.vim @ 34468:f5d114f7440e

runtime(java): Recognise text blocks (#14128) Commit: https://github.com/vim/vim/commit/b3030b653bbdc08c91138001d1987d804f6ebf46 Author: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com> Date: Sun Mar 3 17:51:01 2024 +0300 runtime(java): Recognise text blocks (https://github.com/vim/vim/issues/14128) Also, accept as valid the space escape sequence `\s`. Also, consistently use the claimed `javaDebug` prefix for syntax group definitions kept under `g:java_highlight_debug`. Since `javaStringError` is commented out for its generality, let's comment out `javaDebugStringError`, its copy, as well. References: https://openjdk.org/jeps/378 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7 Closes #10910. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 03 Mar 2024 16:00:10 +0100
parents 02bd0fe77c68
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Elm Filter rules
34375
02bd0fe77c68 runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents: 19180
diff changeset
3 " Maintainer: This runtime file is looking for a new maintainer.
02bd0fe77c68 runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents: 19180
diff changeset
4 " Former Maintainer: Charles E. Campbell
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
5 " Last Change: Aug 31, 2016
19180
8edf0aeb71b9 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
6 " Version: 9
34375
02bd0fe77c68 runtime(misc): announce adoption of various runtime files
Christian Brabandt <cb@256bit.org>
parents: 19180
diff changeset
7 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_ELMFILT
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6479
diff changeset
9 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6479
diff changeset
10 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 syn cluster elmfiltIfGroup contains=elmfiltCond,elmfiltOper,elmfiltOperKey,,elmfiltNumber,elmfiltOperKey
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn match elmfiltParenError "[()]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn match elmfiltMatchError "/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn region elmfiltIf start="\<if\>" end="\<then\>" contains=elmfiltParen,elmfiltParenError skipnl skipwhite nextgroup=elmfiltAction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn region elmfiltParen contained matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=elmfiltParen,@elmfiltIfGroup,elmfiltThenError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn region elmfiltMatch contained matchgroup=Delimiter start="/" skip="\\/" matchgroup=Delimiter end="/" skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match elmfiltThenError "\<then.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match elmfiltComment "^#.*$" contains=@Spell
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn keyword elmfiltAction contained delete execute executec forward forwardc leave save savecopy skipnl skipwhite nextgroup=elmfiltString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match elmfiltArg contained "[^\\]%[&0-9dDhmrsSty&]"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match elmfiltOperKey contained "\<contains\>" skipnl skipwhite nextgroup=elmfiltString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match elmfiltOperKey contained "\<matches\s" nextgroup=elmfiltMatch,elmfiltSpaceError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword elmfiltCond contained cc bcc lines always subject sender from to lines received skipnl skipwhite nextgroup=elmfiltString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match elmfiltNumber contained "\d\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword elmfiltOperKey contained and not skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,elmfiltString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match elmfiltOper contained "\~" skipnl skipwhite nextgroup=elmfiltMatch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match elmfiltOper contained "<=\|>=\|!=\|<\|<\|=" skipnl skipwhite nextgroup=elmfiltString,elmfiltCond,elmfiltOperKey
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
34 syn region elmfiltString contained start='"' skip='"\(\\\\\)*\\["%]' end='"' contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,@Spell
e63691e7c504 updated for version 7.1a
vimboss
parents: 507
diff changeset
35 syn region elmfiltString contained start="'" skip="'\(\\\\\)*\\['%]" end="'" contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match elmfiltSpaceError contained "\s.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Define the default highlighting.
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
39 if !exists("skip_elmfilt_syntax_inits")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
41 hi def link elmfiltAction Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
42 hi def link elmfiltArg Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
43 hi def link elmfiltComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
44 hi def link elmfiltCond Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
45 hi def link elmfiltIf Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
46 hi def link elmfiltMatch Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
47 hi def link elmfiltMatchError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
48 hi def link elmfiltNumber Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
49 hi def link elmfiltOper Operator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
50 hi def link elmfiltOperKey Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
51 hi def link elmfiltParenError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
52 hi def link elmfiltSpaceError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
53 hi def link elmfiltString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
54 hi def link elmfiltThenError Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
56 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 let b:current_syntax = "elmfilt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " vim: ts=9