Mercurial > vim
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 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
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 | 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 | 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 | 11 finish |
12 endif | |
13 | |
14 syn cluster elmfiltIfGroup contains=elmfiltCond,elmfiltOper,elmfiltOperKey,,elmfiltNumber,elmfiltOperKey | |
15 | |
16 syn match elmfiltParenError "[()]" | |
17 syn match elmfiltMatchError "/" | |
18 syn region elmfiltIf start="\<if\>" end="\<then\>" contains=elmfiltParen,elmfiltParenError skipnl skipwhite nextgroup=elmfiltAction | |
19 syn region elmfiltParen contained matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=elmfiltParen,@elmfiltIfGroup,elmfiltThenError | |
20 syn region elmfiltMatch contained matchgroup=Delimiter start="/" skip="\\/" matchgroup=Delimiter end="/" skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey | |
21 syn match elmfiltThenError "\<then.*$" | |
22 syn match elmfiltComment "^#.*$" contains=@Spell | |
23 | |
24 syn keyword elmfiltAction contained delete execute executec forward forwardc leave save savecopy skipnl skipwhite nextgroup=elmfiltString | |
25 syn match elmfiltArg contained "[^\\]%[&0-9dDhmrsSty&]"lc=1 | |
26 | |
27 syn match elmfiltOperKey contained "\<contains\>" skipnl skipwhite nextgroup=elmfiltString | |
28 syn match elmfiltOperKey contained "\<matches\s" nextgroup=elmfiltMatch,elmfiltSpaceError | |
29 syn keyword elmfiltCond contained cc bcc lines always subject sender from to lines received skipnl skipwhite nextgroup=elmfiltString | |
30 syn match elmfiltNumber contained "\d\+" | |
31 syn keyword elmfiltOperKey contained and not skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,elmfiltString | |
32 syn match elmfiltOper contained "\~" skipnl skipwhite nextgroup=elmfiltMatch | |
33 syn match elmfiltOper contained "<=\|>=\|!=\|<\|<\|=" skipnl skipwhite nextgroup=elmfiltString,elmfiltCond,elmfiltOperKey | |
1121 | 34 syn region elmfiltString contained start='"' skip='"\(\\\\\)*\\["%]' end='"' contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,@Spell |
35 syn region elmfiltString contained start="'" skip="'\(\\\\\)*\\['%]" end="'" contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,@Spell | |
7 | 36 syn match elmfiltSpaceError contained "\s.*$" |
37 | |
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 | 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 | 55 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
56 endif |
7 | 57 |
58 let b:current_syntax = "elmfilt" | |
59 " vim: ts=9 |