view runtime/syntax/testdir/dumps/java_switch_00.dump @ 34445:5609b011fd70

runtime(java): Recognise _when_ clauses in _switch_ blocks Commit: https://github.com/vim/vim/commit/9ecf02cd5f5feabe096f66cd5f503a822c78793f Author: Aliaksei Budavei <0x000c70@gmail.com> Date: Wed Feb 28 21:30:22 2024 +0100 runtime(java): Recognise _when_ clauses in _switch_ blocks Also: - distinguish _yield_ when used as a contextual keyword from when used qualified as a method or a method reference (as can be seen in testdir/input/java_switch.java, variables and method declarations named _yield_ will be recognised as the namesake keyword--consider picking other names for variables, and defining g:java_highlight_functions to have method names painted; since _yield_ statements can have trailing parens, they must be recognised as statements, for only qualified _yield_ method calls are supported); - recognise grouped _default_ _case_ labels; - describe primitive types for _case_ labels (JLS, ?14.11, ?3.10.1); - recognise some non-ASCII identifiers (see javaLambdaDef, javaUserLabel) (further improvement for better recognition of identifiers will be arranged in a separate PR). Because the arrow '->' is used in two kinds of expressions, lambda (abstractions) and _switch_, necessary changes were made for the recognition of either (and further improvement touching lambda expressions will be separately arranged). Because 'default' is used for instance method declarations in interfaces and in _switch_ labels, necessary changes were made for the recognition of either (and further improvement touching method declarations will be separately arranged). Finally, it deemed appropriate to put 'yield' in the syntax group of javaOperator rather than javaStatement, for its member 'var' is also another contextual keyword (e.g., this is valid syntax: "var var = var(test.var);"). References: https://openjdk.org/jeps/361 (Switch Expressions) https://openjdk.org/jeps/440 (Record Patterns) https://openjdk.org/jeps/441 (Pattern Matching for switch) Also, add a Java specific filetype plugin for the syntax test, so that no soft-wrapping of long indented lines occur. Otherwise the syntax scripts would miss a few lines during scrolling and verification of the screen dumps. closes: #14105 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 28 Feb 2024 21:45:09 +0100
parents
children
line wrap: on
line source

>c+0#00e0003#ffffff0|l|a|s@1| +0#0000000&|S|w|i|t|c|h|T|e|s|t|s| @2|/+0#0000e05&@1| |J|D|K| |2|1|+|.| +0#0000000&@43
|{| @73
@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&|e|c|h|o|(|O|b|j|e|c|t| |o|)| |{| |S|y|s|t|e|m|.|o|u|t|.|p|r|i|n|t|l|n|(|o|)|;| |}| @17
@75
@4|s+0#00e0003&|t|a|t|i|c| +0#0000000&|{| @62
@8|i+0#00e0003&|n|t|e|r|f|a|c|e| +0#0000000&|Y|i|e|l|d|a|b|l|e|<|T|>| @44
@8|{| @65
@12|T| |y+0#af5f00255&|i|e|l|d|(+0#0000000&|)|;| @52
@12|d+0#4040ff13&|e|f|a|u|l|t| +0#0000000&|Y|i|e|l|d|a|b|l|e|<|T|>| |d|e|f|a|u|l|t|_|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#00e0003&|h|i|s|;+0#0000000&| |}| @14
@12|d+0#4040ff13&|e|f|a|u|l|t| +0#0000000&|Y|i|e|l|d|a|b|l|e|<|T|>| |w|h|e|n|(|)| |{| |r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#00e0003&|h|i|s|;+0#0000000&| |}| @18
@8|}| @65
@75
@8|/+0#0000e05&@1| |T|h|e|r|e| |a|r|e| |8|0| |b|y|t|e|s| |(|\|@|8|0|<|!|)| |b|e|t|w|e@1|n| |"|:@1|"| |a|n|d| |"|y|i|e|l|d|;|"|.| +0#0000000&@9
@8|Y|i|e|l|d|a|b|l|e|<|?|>| |y| |=| |(@1|Y|i|e|l|d|a|b|l|e|<|?|>|)| |(|)| |-|>| |0+0#e000002&|)+0#0000000&|:@1| @23
@75
@4|y|i|e|l|d|;| @64
@8|(@1|Y|i|e|l|d|a|b|l|e|<|?|>|)| |(|)| |-|>| |0+0#e000002&|)+0#0000000&|.|w|h|e|n|(|)|.|d|e|f|a|u|l|t|_|(|)|.|y|i|e|l|d|(|)|;| @15
@75
@8|e+0#00e0003&|n|u|m| +0#0000000&|L|e|t@1|e|r|s| |{| |O|T|H|E|R|,| |A|L|P|H|A|,| |B|E|T|A| |}| @31
@57|1|,|1| @10|T|o|p|