runtime(java): Recognise string templates (#14150)
As this is encouraged in the referenced JEPs, "to visually
distinguish a string template from a string literal, and
a text block template from a text block", the default
colours for java\%[Debug]StrTempl are made distinct from
java\%[Debug]String.
According to §3.2 Lexical Translations (JLS, c. 1996 or any
more recent version), line terminators, white space, and
comments are discarded before tokens are accepted. Since
a template expression comprises a template processor, a dot,
and a template, it may be visually appealing to break up
its head across a few lines whenever its tail already spans
multiple lines. Curiously, no allowance for it is made in
the distributed tests for OpenJDK 21; the proposed regexp
patterns take in consideration a line terminator and white
space after a dot.
References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-09 20:03:11 +03:00
|
|
|
| +0&#ffffff0@11|.|"@2| @58
|
|
|
|
| +0#e000e06&@11|%|-|1|4|s|\|{|S+0#0000000&|T|R|.|"@2| @48
|
|
|
|
| +0#e000e06&@15|A|\|s|\| +0#0000000&@54
|
|
|
|
| +0#e000e06&@15|\|{| +0#0000000&|"+0#e000002&|q|u|i|c|k|"| +0#0000000&|}+0#e000e06&| |\| +0#0000000&@44
|
|
|
|
| +0#e000e06&@15|b|r|o|w|n|"+0#0000000&@2|}+0#e000e06&|\| +0#0000000&@48
|
|
|
|
| +0#e000e06&@11>%|s|\|{| +0#0000000&|f|o|x| |}+0#e000e06&| |\| +0#0000000&@50
|
|
|
|
| +0#e000e06&@11|%|-|2|0|s|\|{|S+0#0000000&|T|R|.|"@2| @48
|
|
|
|
| +0#e000e06&@15|j|u|m|p|s|\|s|\| +0#0000000&@50
|
|
|
|
| +0#e000e06&@15|o|v|e|r| |\| +0#0000000&@52
|
|
|
|
| +0#e000e06&@15|t|h|e|\|s|\| +0#0000000&@52
|
|
|
|
| +0#e000e06&@15|\|{| +0#0000000&|"+0#e000002&|l|a|z|y|"| +0#0000000&|}+0#e000e06&| |"+0#0000000&@2|}+0#e000e06&|\| +0#0000000&@41
|
|
|
|
| +0#e000e06&@11|%|s|\|{| +0#0000000&|d|o|g| |}+0#e000e06&|"+0#0000000&@2|;| @48
|
2024-08-27 22:32:13 +02:00
|
|
|
@8|S|t|r|i|n|g| |s|8| |=| |S|T|R| @51
|
runtime(java): Recognise string templates (#14150)
As this is encouraged in the referenced JEPs, "to visually
distinguish a string template from a string literal, and
a text block template from a text block", the default
colours for java\%[Debug]StrTempl are made distinct from
java\%[Debug]String.
According to §3.2 Lexical Translations (JLS, c. 1996 or any
more recent version), line terminators, white space, and
comments are discarded before tokens are accepted. Since
a template expression comprises a template processor, a dot,
and a template, it may be visually appealing to break up
its head across a few lines whenever its tail already spans
multiple lines. Curiously, no allowance for it is made in
the distributed tests for OpenJDK 21; the proposed regexp
patterns take in consideration a line terminator and white
space after a dot.
References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-09 20:03:11 +03:00
|
|
|
@12|.|"+0#e000e06&|\|"|\|{| +0#0000000&@9|/+0#0000e05&|*| |A| |n|e|s|t|e|d| |c|o|m@1|e|n|t|.| |*|/| +0#0000000&@23
|
|
|
|
@8|(@1|j|a|v|a|.|u|t|i|l|.|f|u|n|c|t|i|o|n|.|F|u|n|c|t|i|o|n|<|S|t|r|i|n|g|,| |S|t|r|i|n|g|>|)| |b|a|y| |-|>| |b|a|y|)| @8
|
|
|
|
@28|.|a|p@1|l|y|(|w|o@1|f|)| @34
|
|
|
|
@12|}+0#e000e06&|\|s|!|\|"@1|;+0#0000000&| @54
|
|
|
|
@4|}| @69
|
|
|
|
|}| @73
|
2024-08-27 22:32:13 +02:00
|
|
|
@57|5@1|,|4|-|1|3| @6|B|o|t|
|