Mercurial > vim
annotate runtime/syntax/acedb.vim @ 35039:fbdb6aeca2e2
runtime(java): Improve the recognition of the "style" method declarations
Commit: https://github.com/vim/vim/commit/a4c085a3e607bd01d34e1db600b6460fc35fb0a3
Author: Aliaksei Budavei <0x000c70@gmail.com>
Date: Wed Apr 24 21:04:25 2024 +0200
runtime(java): Improve the recognition of the "style" method declarations
- Request the new regexp engine (v7.3.970) for [:upper:] and
[:lower:].
- Recognise declarations of in-line annotated methods.
- Recognise declarations of _strictfp_ methods.
- Establish partial order for method modifiers as shown in
the MethodModifier production; namely, _public_ and
friends should be written the leftmost, possibly followed
by _abstract_ or _default_, or possibly followed by other
modifiers.
- Stop looking for parameterisable primitive types (void<?>,
int<Object>, etc., are malformed).
- Stop looking for arrays of _void_.
- Acknowledge the prevailing convention for method names to
begin with a small letter and for class/interface names to
begin with a capital letter; and, therefore, desist from
claiming declarations of enum constants and constructors
with javaFuncDef.
Rationale:
+ Constructor is distinct from method:
* its (overloaded) name is not arbitrary;
* its return type is implicit;
* its _throws_ clause depends on indirect vagaries of
instance (variable) initialisers;
* its invocation makes other constructors of its type
hierarchy invoked one by one, concluding with the
primordial constructor;
* its explicit invocation, via _this_ or _super_, can
only appear as the first statement in a constructor
(not anymore, see JEP 447); else, its _super_ call
cannot appear in constructors of _record_ or _enum_;
and neither invocation is allowed for the primordial
constructor;
* it is not a member of its class, like initialisers,
and is never inherited;
* it is never _abstract_ or _native_.
+ Constructor declarations tend to be few in number and
merit visual recognition from method declarations.
+ Enum constants define a fixed set of type instances
and more resemble class variable initialisers.
Note that the code duplicated for @javaFuncParams is written
keeping in mind for g:java_highlight_functions a pending 3rd
variant, which would require none of the :syn-cluster added
groups.
closes: #14620
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 24 Apr 2024 21:15:02 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: AceDB model files | |
3 " Maintainer: Stewart Morris (Stewart.Morris@ed.ac.uk) | |
4 " Last change: Thu Apr 26 10:38:01 BST 2001 | |
5 " URL: http://www.ed.ac.uk/~swmorris/vim/acedb.vim | |
6 | |
7 " Syntax file to handle all $ACEDB/wspec/*.wrm files, primarily models.wrm | |
8 " AceDB software is available from http://www.acedb.org | |
9 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
10 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
11 if exists("b:current_syntax") |
7 | 12 finish |
13 endif | |
14 | |
15 syn keyword acedbXref XREF | |
16 syn keyword acedbModifier UNIQUE REPEAT | |
17 | |
18 syn case ignore | |
19 syn keyword acedbModifier Constraints | |
20 syn keyword acedbType DateType Int Text Float | |
21 | |
22 " Magic tags from: http://genome.cornell.edu/acedocs/magic/summary.html | |
23 syn keyword acedbMagic pick_me_to_call No_cache Non_graphic Title | |
24 syn keyword acedbMagic Flipped Centre Extent View Default_view | |
25 syn keyword acedbMagic From_map Minimal_view Main_Marker Map Includes | |
26 syn keyword acedbMagic Mapping_data More_data Position Ends Left Right | |
27 syn keyword acedbMagic Multi_Position Multi_Ends With Error Relative | |
28 syn keyword acedbMagic Min Anchor Gmap Grid_map Grid Submenus Cambridge | |
29 syn keyword acedbMagic No_buttons Columns Colour Surround_colour Tag | |
30 syn keyword acedbMagic Scale_unit Cursor Cursor_on Cursor_unit | |
31 syn keyword acedbMagic Locator Magnification Projection_lines_on | |
32 syn keyword acedbMagic Marker_points Marker_intervals Contigs | |
33 syn keyword acedbMagic Physical_genes Two_point Multi_point Likelihood | |
34 syn keyword acedbMagic Point_query Point_yellow Point_width | |
35 syn keyword acedbMagic Point_pne Point_pe Point_nne Point_ne | |
36 syn keyword acedbMagic Derived_tags DT_query DT_width DT_no_duplicates | |
37 syn keyword acedbMagic RH_data RH_query RH_spacing RH_show_all | |
38 syn keyword acedbMagic Names_on Width Symbol Colours Pne Pe Nne pMap | |
39 syn keyword acedbMagic Sequence Gridded FingerPrint In_Situ Cosmid_grid | |
40 syn keyword acedbMagic Layout Lines_at Space_at No_stagger A1_labelling | |
41 syn keyword acedbMagic DNA Structure From Source Source_Exons | |
42 syn keyword acedbMagic Coding CDS Transcript Assembly_tags Allele | |
43 syn keyword acedbMagic Display Colour Frame_sensitive Strand_sensitive | |
44 syn keyword acedbMagic Score_bounds Percent Bumpable Width Symbol | |
45 syn keyword acedbMagic Blixem_N Address E_mail Paper Reference Title | |
46 syn keyword acedbMagic Point_1 Point_2 Calculation Full One_recombinant | |
47 syn keyword acedbMagic Tested Selected_trans Backcross Back_one | |
48 syn keyword acedbMagic Dom_semi Dom_let Direct Complex_mixed Calc | |
49 syn keyword acedbMagic Calc_upper_conf Item_1 Item_2 Results A_non_B | |
50 syn keyword acedbMagic Score Score_by_offset Score_by_width | |
51 syn keyword acedbMagic Right_priority Blastn Blixem Blixem_X | |
52 syn keyword acedbMagic Journal Year Volume Page Author | |
53 syn keyword acedbMagic Selected One_all Recs_all One_let | |
54 syn keyword acedbMagic Sex_full Sex_one Sex_cis Dom_one Dom_selected | |
55 syn keyword acedbMagic Calc_distance Calc_lower_conf Canon_for_cosmid | |
56 syn keyword acedbMagic Reversed_physical Points Positive Negative | |
57 syn keyword acedbMagic Point_error_scale Point_segregate_ordered | |
58 syn keyword acedbMagic Point_symbol Interval_JTM Interval_RD | |
59 syn keyword acedbMagic EMBL_feature Homol Feature | |
60 syn keyword acedbMagic DT_tag Spacer Spacer_colour Spacer_width | |
61 syn keyword acedbMagic RH_positive RH_negative RH_contradictory Query | |
62 syn keyword acedbMagic Clone Y_remark PCR_remark Hybridizes_to | |
63 syn keyword acedbMagic Row Virtual_row Mixed In_pool Subpool B_non_A | |
64 syn keyword acedbMagic Interval_SRK Point_show_marginal Subsequence | |
65 syn keyword acedbMagic Visible Properties Transposon | |
66 | |
67 syn match acedbClass "^?\w\+\|^#\w\+" | |
68 syn match acedbComment "//.*" | |
69 syn region acedbComment start="/\*" end="\*/" | |
70 syn match acedbComment "^#\W.*" | |
71 syn match acedbHelp "^\*\*\w\+$" | |
72 syn match acedbTag "[^^]?\w\+\|[^^]#\w\+" | |
73 syn match acedbBlock "//#.\+#$" | |
74 syn match acedbOption "^_[DVH]\S\+" | |
75 syn match acedbFlag "\s\+-\h\+" | |
76 syn match acedbSubclass "^Class" | |
77 syn match acedbSubtag "^Visible\|^Is_a_subclass_of\|^Filter\|^Hidden" | |
78 syn match acedbNumber "\<\d\+\>" | |
79 syn match acedbNumber "\<\d\+\.\d\+\>" | |
80 syn match acedbHyb "\<Positive_\w\+\>\|\<Negative\w\+\>" | |
81 syn region acedbString start=/"/ end=/"/ skip=/\\"/ oneline | |
82 | |
83 " Rest of syntax highlighting rules start here | |
84 | |
85 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
86 " Only when an item doesn't have highlighting yet |
7 | 87 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
88 hi def link acedbMagic Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
89 hi def link acedbHyb Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
90 hi def link acedbType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
91 hi def link acedbOption Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
92 hi def link acedbSubclass Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
93 hi def link acedbSubtag Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
94 hi def link acedbFlag Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
95 hi def link acedbTag Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
96 hi def link acedbClass Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
97 hi def link acedbHelp Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
98 hi def link acedbXref Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
99 hi def link acedbModifier Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
100 hi def link acedbComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
101 hi def link acedbBlock ModeMsg |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
102 hi def link acedbNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
103 hi def link acedbString String |
7 | 104 |
105 | |
106 let b:current_syntax = "acedb" | |
107 | |
108 " The structure of the model.wrm file is sensitive to mixed tab and space | |
109 " indentation and assumes tabs are 8 so... | |
110 se ts=8 |