summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/testdir/dumps/java_switch_04.dump
diff options
context:
space:
mode:
authorAliaksei Budavei <0x000c70@gmail.com>2024-02-28 21:30:22 +0100
committerChristian Brabandt <cb@256bit.org>2024-02-28 21:33:45 +0100
commit9ecf02cd5f5feabe096f66cd5f503a822c78793f (patch)
treea957d1bd4ceb56e3f7b2ea24b3fe3710887ca60d /runtime/syntax/testdir/dumps/java_switch_04.dump
parent56824430c02bd557cc41737eacd3edb2453ed4f9 (diff)
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>
Diffstat (limited to 'runtime/syntax/testdir/dumps/java_switch_04.dump')
-rw-r--r--runtime/syntax/testdir/dumps/java_switch_04.dump20
1 files changed, 20 insertions, 0 deletions
diff --git a/runtime/syntax/testdir/dumps/java_switch_04.dump b/runtime/syntax/testdir/dumps/java_switch_04.dump
new file mode 100644
index 0000000000..38dfe4096c
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/java_switch_04.dump
@@ -0,0 +1,20 @@
+| +0&#ffffff0@7|s+0#af5f00255&|w|i|t|c|h| +0#0000000&|(|c|h|)| |{| @53
+@8|c+0#af5f00255&|a|s|e| +0#0000000&|'+0#e000002&|a|'|:+0#0000000&| @6|{| |e|c|h|o|(|'+0#e000002&|a|'|)+0#0000000&|;| |b+0#af5f00255&|r|e|a|k|;+0#0000000&| |}| @29
+@8|c+0#af5f00255&|a|s|e| +0#0000000&|'+0#e000002&|b|'|:+0#0000000&| @6|{| |e|c|h|o|(|'+0#e000002&|b|'|)+0#0000000&|;| |b+0#af5f00255&|r|e|a|k|;+0#0000000&| |}| @29
+@8|d+0#af5f00255&|e|f|a|u|l|t|:+0#0000000&| @7|{| |e|c|h|o|(|'+0#e000002&|\+0#e000e06&|u|0@3|'+0#e000002&|)+0#0000000&|;| |b+0#af5f00255&|r|e|a|k|;+0#0000000&| |}| @24
+@8|}|;| @64
+> @74
+@8|e|c|h|o|(|s+0#af5f00255&|w|i|t|c|h| +0#0000000&|(|c|h|)| |{| @48
+@12|c+0#af5f00255&|a|s|e| +0#0000000&|'+0#e000002&|a|'| +0#0000000&@3|-|>| |'+0#e000002&|a|'|;+0#0000000&| @43
+@12|c+0#af5f00255&|a|s|e| +0#0000000&|'+0#e000002&|b|'| +0#0000000&@3|-|>| |'+0#e000002&|b|'|;+0#0000000&| @43
+@12|d+0#af5f00255&|e|f|a|u|l|t| +0#0000000&@4|-|>| |'+0#e000002&|\+0#e000e06&|u|0@3|'+0#e000002&|;+0#0000000&| @38
+@8|}|)|;| @63
+@75
+@8|b+0#00e0003&|y|t|e| +0#0000000&|b| |=| |(|b+0#00e0003&|y|t|e|)+0#0000000&| |2+0#e000002&|;+0#0000000&| @48
+@75
+@8|s+0#af5f00255&|w|i|t|c|h| +0#0000000&|(|b|)| |{| @54
+@8|c+0#af5f00255&|a|s|e| +0#0000000&|(@1|b+0#00e0003&|y|t|e|)+0#0000000&| |0+0#e000002&|)+0#0000000&|:| @3|{| |e|c|h|o|(@1|b+0#00e0003&|y|t|e|)+0#0000000&| |0+0#e000002&|)+0#0000000&|;| |b+0#af5f00255&|r|e|a|k|;+0#0000000&| |}| @20
+@8|c+0#af5f00255&|a|s|e| +0#0000000&|(@1|b+0#00e0003&|y|t|e|)+0#0000000&| |1+0#e000002&|)+0#0000000&|:| @3|{| |e|c|h|o|(@1|b+0#00e0003&|y|t|e|)+0#0000000&| |1+0#e000002&|)+0#0000000&|;| |b+0#af5f00255&|r|e|a|k|;+0#0000000&| |}| @20
+@8|d+0#af5f00255&|e|f|a|u|l|t|:+0#0000000&| @7|{| |e|c|h|o|(@1|b+0#00e0003&|y|t|e|)+0#0000000&| |-|1+0#e000002&|)+0#0000000&|;| |b+0#af5f00255&|r|e|a|k|;+0#0000000&| |}| @23
+@8|}|;| @64
+@57|7|3|,|0|-|1| @7|6|5|%|