runtime(java): Compose "g:java_highlight_signature" and "g:java_highlight_functions"
With the variables defined, distinctly highlight parts of a method declaration header: its name and parameter list parens, from its type parameters, return type, and formal parameters; and distinctly highlight parts of a lambda expression: its parameter list parens and the arrow, from its formal parameters and identifiers. closes: #15083 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
88bbdb04c2
commit
01a4fb104d
78
runtime/syntax/testdir/input/java_annotations_signature.java
Normal file
78
runtime/syntax/testdir/input/java_annotations_signature.java
Normal file
@ -0,0 +1,78 @@
|
||||
// VIM_TEST_SETUP let g:java_highlight_functions = 'style'
|
||||
// VIM_TEST_SETUP let g:java_highlight_signature = 1
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
class Annotations$Tests
|
||||
{
|
||||
@Target(ElementType.TYPE_USE)
|
||||
@interface Tag
|
||||
{
|
||||
String value() default "";
|
||||
String kind() default "";
|
||||
}
|
||||
|
||||
@Target(ElementType.TYPE_USE)
|
||||
@interface Text
|
||||
{
|
||||
String[] value() default {""};
|
||||
}
|
||||
|
||||
@Target({
|
||||
ElementType.METHOD,
|
||||
ElementType.PARAMETER,
|
||||
ElementType.TYPE,
|
||||
})
|
||||
@interface Labels
|
||||
{
|
||||
Label[] value();
|
||||
}
|
||||
|
||||
@java.lang.annotation.Target({
|
||||
java.lang.annotation.ElementType.METHOD,
|
||||
java.lang.annotation.ElementType.PARAMETER,
|
||||
java.lang.annotation.ElementType.TYPE,
|
||||
})
|
||||
@java.lang.annotation.Repeatable(Labels.class)
|
||||
@interface Label
|
||||
{
|
||||
String value() default "";
|
||||
Class<?> type() default Label.class;
|
||||
boolean redundant() default true;
|
||||
Text text() default @Text;
|
||||
Tag head() default @Tag();
|
||||
Tag tail() default @Tag(value = "", kind = "");
|
||||
}
|
||||
|
||||
/* Use identity cast expressions to nest TYPE_USE annotations. */
|
||||
@Label(
|
||||
(@Text({
|
||||
(@Text({ "a", "aa", "aaa", "aaaa", }) String) "as",
|
||||
(@Text({ "b", "bb", "bbb", "bbbb", }) String) "bs",
|
||||
(@Text({ "c", "cc", "ccc", "cccc", }) String) "cs",
|
||||
(@Text({ "d", "dd", "ddd", "dddd", }) String) "ds",
|
||||
}) String) "abcd")
|
||||
interface Primer { }
|
||||
|
||||
@Label @Label() @Label("""
|
||||
n\
|
||||
o\
|
||||
O\
|
||||
p""")
|
||||
@Label(head = @Tag(value = "@Label"/*, kind = "name"*/))
|
||||
@Label(// value = "Method",
|
||||
type = Annotations$Tests.class,
|
||||
redundant = !!!(1 != 1),
|
||||
head = @Tag(value = "@Label"),
|
||||
text = @Text({ "})", "({" }))
|
||||
static void noOp(@Label @Label() @Label("dummy")
|
||||
@Label(head = @Tag(/*value = "@Label",*/ kind = "name"))
|
||||
@Label(// value = "Parameter",
|
||||
type = Annotations$Tests.class,
|
||||
head = @Tag(value = "@Label"),
|
||||
text = @Text({ "){", "}(" }))
|
||||
Object dummy)
|
||||
{
|
||||
}
|
||||
}
|
||||
140
runtime/syntax/testdir/input/java_generics_signature.java
Normal file
140
runtime/syntax/testdir/input/java_generics_signature.java
Normal file
@ -0,0 +1,140 @@
|
||||
// VIM_TEST_SETUP let g:java_highlight_functions = 'style'
|
||||
// VIM_TEST_SETUP let g:java_highlight_signature = 1
|
||||
// VIM_TEST_SETUP let g:java_highlight_generics = 1
|
||||
// VIM_TEST_SETUP hi link javaGenericsC1 Todo
|
||||
// VIM_TEST_SETUP hi link javaGenericsC2 Error
|
||||
import java.math.BigInteger;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.LongFunction;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
class Generics$Tests<T extends Number & Comparable<? super T>, U>
|
||||
{ // JDK 21+.
|
||||
static final Function<Function<Object, Object>, Object> PARTIAL =
|
||||
Generics$Tests.y0();
|
||||
static final Function<BigInteger, BigInteger> FACTORIAL_2000 =
|
||||
Generics$Tests.<BigInteger, BigInteger>y1()
|
||||
.apply(f -> x -> (x.compareTo(BigInteger.ONE) < 1)
|
||||
? BigInteger.ONE
|
||||
: x.multiply(f.apply(x.subtract(BigInteger.ONE))));
|
||||
|
||||
static <T1> Y0<T1> y0()
|
||||
{
|
||||
return (Function<T1, T1> f) -> f.apply(
|
||||
Generics$Tests.<T1>y0()
|
||||
.apply(f));
|
||||
}
|
||||
|
||||
static <T1, T2> Y1<T1, T2> y1()
|
||||
{
|
||||
return (Function<Function<T1, T2>, Function<T1, T2>> f) ->
|
||||
(T1 x) -> f.apply(Generics$Tests.<T1, T2>y1()
|
||||
.apply(f))
|
||||
.apply(x);
|
||||
}
|
||||
|
||||
static<T> void noOp(T dummy) { }
|
||||
|
||||
interface alpha<T> { }
|
||||
|
||||
interface Y0<T1> extends Function<Function<T1, T1>, T1> { }
|
||||
|
||||
interface Y1<T1, T2> extends Function<Function<Function<T1, T2>,
|
||||
Function<T1, T2>>,
|
||||
Function<T1, T2>> { }
|
||||
|
||||
interface Stackable<E> extends Iterable<E>
|
||||
{
|
||||
boolean isEmpty();
|
||||
E peek();
|
||||
E pop();
|
||||
Stackable<E> popAll(Stackable<? super E> elements);
|
||||
Stackable<E> popSome(Stackable<? super E> elements,
|
||||
Predicate<? super E> filter);
|
||||
Stackable<E> push(E element);
|
||||
Stackable<E> pushAll(Iterable<? extends E> elements);
|
||||
Stackable<E> pushSome(Iterable<? extends E> elements,
|
||||
Predicate<? super E> filter);
|
||||
Stackable<E> wind(Consumer<? super Stackable<E>> action);
|
||||
}
|
||||
|
||||
sealed interface Num<N extends Number>
|
||||
{
|
||||
int radix();
|
||||
N value();
|
||||
}
|
||||
|
||||
record Bin<N extends Number>(N value) implements Num<N>
|
||||
{
|
||||
public int radix() { return 2; }
|
||||
}
|
||||
|
||||
record Dec<N extends Number>(N value) implements Num<N>
|
||||
{
|
||||
public int radix() { return 10; }
|
||||
}
|
||||
|
||||
record Hex<N extends Number>(N value) implements Num<N>
|
||||
{
|
||||
public int radix() { return 16; }
|
||||
}
|
||||
|
||||
record Oct<N extends Number>(N value) implements Num<N>
|
||||
{
|
||||
public int radix() { return 8; }
|
||||
}
|
||||
|
||||
static Num<Long> fromDecimal(long x, int radix)
|
||||
{
|
||||
record Pair(LongFunction<Num<Long>> a,
|
||||
LongFunction<String> b) { }
|
||||
final Pair p = switch (radix) {
|
||||
case 2 -> new Pair(Bin::new, Long::toBinaryString);
|
||||
case 8 -> new Pair(Oct::new, Long::toOctalString);
|
||||
case 16 -> new Pair(Hex::new, Long::toHexString);
|
||||
default -> new Pair(Dec::new,
|
||||
y -> Long.toString(y));
|
||||
};
|
||||
return p.a().apply(Long.parseLong(p.b().apply(x), radix));
|
||||
}
|
||||
|
||||
static long toDecimal(Num<Long> x)
|
||||
{
|
||||
return Long.parseLong(switch (x) {
|
||||
case Bin<?>(Long b) -> Long.toBinaryString(b);
|
||||
case Oct<?>(Long o) -> Long.toOctalString(o);
|
||||
case Hex<?>(Long h) -> Long.toHexString(h);
|
||||
default -> Long.toString(x.value());
|
||||
}, x.radix());
|
||||
}
|
||||
|
||||
@java.lang.annotation.Target(
|
||||
java.lang.annotation.ElementType.TYPE_USE)
|
||||
@interface Taggable
|
||||
{
|
||||
String value() default "";
|
||||
}
|
||||
|
||||
{
|
||||
int N = 0, X = 1, Y = 2;
|
||||
Predicate<T> f = y->N<y.intValue();
|
||||
Predicate<T> g = y->X<N&&(Integer)y>N;
|
||||
boolean[] bb = {
|
||||
X<N||N>Y, X < Y, X <Y, X <(Y), X<(Y), (X)<Y,
|
||||
Double.isFinite(X<<Y),
|
||||
X<=Y, X<(int)(byte)Y, X<~Y, X<-Y, X<+Y,
|
||||
};
|
||||
Class<?> klass = Generics$Tests.class;
|
||||
Class< java.lang.Class<@Taggable("<>")int[][]> [] [] >
|
||||
[ ] [ ] $ [ ] [ ];
|
||||
if (false) { new Generics$Tests<>(); }
|
||||
alpha<?> ao;
|
||||
alpha<U> au;
|
||||
alpha<alpha<U>> aau;
|
||||
alpha<Y0<?>> ay0o;
|
||||
alpha<Y0<U>> ay0u;
|
||||
Y0<alpha<?>> y0ao;
|
||||
Y0<alpha<U>> y0au;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,154 @@
|
||||
// VIM_TEST_SETUP let g:java_highlight_functions = 'style'
|
||||
// VIM_TEST_SETUP let g:java_highlight_signature = 1
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.util.function.BinaryOperator;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
class LambdaExpressions$Tests // JDK 21+.
|
||||
{
|
||||
<I1, C1, C2, T1, T2, T3, Z1, Z2, Z3, S1, S2, S3> void test()
|
||||
{ // Schönfinkel's functions.
|
||||
I<I1> i = x -> x;
|
||||
C<C1, C2> c = x -> y -> x;
|
||||
T<T1, T2, T3> t = f -> y -> x -> f.apply(x).apply(y);
|
||||
Z<Z1, Z2, Z3> z = f -> g -> x -> f.apply(g.apply(x));
|
||||
S<S1, S2, S3> s = f -> g -> x -> f.apply(x)
|
||||
.apply(g.apply(x));
|
||||
|
||||
I<I1> i01 = (var x) -> x;
|
||||
I<I1> i02 = (@Taggable var x) -> x;
|
||||
I<I1> i03 = (@Taggable @Taggable var x) -> x;
|
||||
I<I1> i04 = (final var x) -> x;
|
||||
I<I1> i05 = (@Taggable final var x) -> x;
|
||||
I<I1> i06 = (@Taggable @Taggable final var x) -> x;
|
||||
I<I1> i07 = (I1 x) -> x;
|
||||
I<I1> i08 = (@Taggable I1 x) -> x;
|
||||
I<I1> i09 = (@Taggable @Taggable I1 x) -> x;
|
||||
I<I1> i10 = (final I1 x) -> x;
|
||||
I<I1> i11 = (@Taggable final I1 x) -> x;
|
||||
I<I1> i12 = (@Taggable @Taggable final I1 x) -> x;
|
||||
|
||||
I<I1[]> ii01 = (I1... x) -> x;
|
||||
I<I1[]> ii02 = (@Taggable I1... x) -> x;
|
||||
I<I1[]> ii03 = (@Taggable @Taggable I1... x) -> x;
|
||||
I<I1[]> ii04 = (final I1... x) -> x;
|
||||
I<I1[]> ii05 = (@Taggable final I1... x) -> x;
|
||||
I<I1[]> ii06 = (@Taggable @Taggable final I1... x) -> x;
|
||||
|
||||
BinaryOperator<I1> leftConst01 = (var x, var y) -> x;
|
||||
BinaryOperator<I1> leftConst02 = (@Taggable var x,
|
||||
@Taggable var y) -> x;
|
||||
BinaryOperator<I1> leftConst03 = (@Taggable @Taggable var
|
||||
x, @Taggable @Taggable var y) -> x;
|
||||
BinaryOperator<I1> leftConst04 = (final var x,
|
||||
final var y) -> x;
|
||||
BinaryOperator<I1> leftConst05 = (@Taggable final
|
||||
var x, @Taggable final var y) -> x;
|
||||
BinaryOperator<I1> leftConst06 = (@Taggable
|
||||
@Taggable final var x,
|
||||
@Taggable
|
||||
@Taggable final var y) -> x;
|
||||
BinaryOperator<I1> leftConst07 = (I1 x, I1 y) -> x;
|
||||
BinaryOperator<I1> leftConst08 = (@Taggable I1 x,
|
||||
@Taggable I1 y) -> x;
|
||||
BinaryOperator<I1> leftConst09 = (@Taggable @Taggable I1
|
||||
x, @Taggable @Taggable I1 y) -> x;
|
||||
BinaryOperator<I1> leftConst10 = (final I1 x,
|
||||
final I1 y) -> x;
|
||||
BinaryOperator<I1> leftConst11 = (@Taggable final
|
||||
I1 x, @Taggable final I1 y) -> x;
|
||||
BinaryOperator<I1> leftConst12 = (@Taggable
|
||||
@Taggable final I1 x,
|
||||
@Taggable
|
||||
@Taggable final I1 y) -> x;
|
||||
|
||||
Runnable noOp = () -> {};
|
||||
BinaryOperator<I1> leftConst = (x, y) -> x;
|
||||
I<I1> id1 = (x) -> (x);
|
||||
@SuppressWarnings("unchecked") I<I1> id2 =
|
||||
((I<I<I1>>) (I<?>) (Function<I1,
|
||||
I1> x) -> x).apply(switch (0) {
|
||||
case ((int) (byte) 1) -> (I1 x) -> x;
|
||||
default -> (@Taggable I1 x) -> x; });
|
||||
C<C1, C2> const1 = (x) -> (y) -> (x);
|
||||
C<C1, C2> const2 = switch(switch ("") {
|
||||
case "->"->"(s)->(s)";
|
||||
default->"default"; }) {
|
||||
case ("->")->(var x)->(var y)->(x);
|
||||
default->(@Taggable var x)->(@Taggable var y)
|
||||
->(x);
|
||||
};
|
||||
}
|
||||
|
||||
@java.lang.annotation.Target(ElementType.PARAMETER)
|
||||
@java.lang.annotation.Repeatable(Taggables.class)
|
||||
@interface Taggable { String[] value() default ""; }
|
||||
|
||||
@java.lang.annotation.Target(ElementType.PARAMETER)
|
||||
@interface Taggables { Taggable[] value(); }
|
||||
|
||||
interface I<A1> extends Function<A1, A1> { }
|
||||
interface C<A1, A2> extends Function<A1, Function<A2, A1>> { }
|
||||
interface T<A1, A2, A3> extends
|
||||
Function<Function<A1, Function<A2, A3>>,
|
||||
Function<A2,
|
||||
Function<A1, A3>>> { }
|
||||
interface Z<A1, A2, A3> extends Function<Function<A2, A3>,
|
||||
Function<Function<A1, A2>,
|
||||
Function<A1, A3>>> { }
|
||||
interface S<A1, A2, A3> extends
|
||||
Function<Function<A1, Function<A2, A3>>,
|
||||
Function<Function<A1, A2>,
|
||||
Function<A1, A3>>> { }
|
||||
|
||||
static void echo(Object o) { System.out.println(o); }
|
||||
|
||||
static {
|
||||
enum Letters { OTHER, ALPHA, BETA }
|
||||
|
||||
Letters other = Letters.OTHER;
|
||||
|
||||
switch (other) {
|
||||
case Letters alpha when Letters.ALPHA == alpha:
|
||||
{ echo(alpha); break; }
|
||||
case Letters beta when Letters.BETA == beta:
|
||||
{ echo(beta); break; }
|
||||
default: { echo(other); }
|
||||
}
|
||||
|
||||
echo(switch (other) {
|
||||
case Letters alpha when Letters.ALPHA == alpha
|
||||
-> alpha;
|
||||
case Letters beta when Letters.BETA == beta
|
||||
-> beta;
|
||||
default -> other;
|
||||
});
|
||||
|
||||
switch (null) {
|
||||
case String str when !"<empty>".equals(switch (str) {
|
||||
case String str_ when
|
||||
Predicate.<String>not(text ->
|
||||
!text.isEmpty())
|
||||
.test(str_)
|
||||
-> "<empty>";
|
||||
case String str_ -> str_;
|
||||
}): { echo(str); break; }
|
||||
case null: default: { echo("Other"); }
|
||||
};
|
||||
|
||||
echo(switch (null) {
|
||||
case String str when !"<empty>".equals(
|
||||
switch (str) {
|
||||
case String str_ when
|
||||
Predicate.<String>not(text ->
|
||||
!text.isEmpty())
|
||||
.test(str_)
|
||||
-> "<empty>";
|
||||
case String str_ -> str_;
|
||||
}) -> str;
|
||||
case null, default -> "Other";
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -84,9 +84,21 @@ abstract class Indent2MethodsTests
|
||||
enum E2
|
||||
{
|
||||
@SuppressWarnings("bespoke") A("a"),
|
||||
B("b"),
|
||||
C("c"), D("d"),
|
||||
E("e"), F("f"), G("g"), H("h");
|
||||
B("b"
|
||||
/*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/),
|
||||
C("c", new Thread(
|
||||
|
||||
() -> {
|
||||
})), D("d", (java.util.function.BooleanSupplier) () -> true),
|
||||
E("e", new char[] { 'a', 'b', 'c', 'd' }), F("f", new Object() {
|
||||
transient String name = "";
|
||||
@Override public String toString() { return this.name; }
|
||||
}), //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//
|
||||
G("g"), @Deprecated H("h");
|
||||
|
||||
final String s;
|
||||
private E2(String s) { this.s = s; }
|
||||
private <δ> E2(String s, δ dummy) { this(s); }
|
||||
|
||||
@Override public String toString() { return name().toUpperCase(); }
|
||||
}
|
||||
|
||||
104
runtime/syntax/testdir/input/java_methods_indent2_signature.java
Normal file
104
runtime/syntax/testdir/input/java_methods_indent2_signature.java
Normal file
@ -0,0 +1,104 @@
|
||||
// VIM_TEST_SETUP let g:java_highlight_functions = 'indent2'
|
||||
// VIM_TEST_SETUP let g:java_highlight_signature = 1
|
||||
// VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
abstract class Indent2$MethodsTests
|
||||
{ // DO NOT retab! THIS FILE; REMEMBER ABOUT testdir/ftplugin.
|
||||
// TYPES.
|
||||
record Τʬ<α>(α a) { }
|
||||
|
||||
enum E
|
||||
{
|
||||
A("a"), B("b"), C("c"), D("d"),
|
||||
E("e"), F("f"), G("g"), H("h");
|
||||
final String s;
|
||||
private E(String s) { this.s = s; }
|
||||
}
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@java.lang.annotation.Repeatable(Tɐggablɘs.class)
|
||||
@interface Tɐggablɘ
|
||||
{
|
||||
String[] value() default "";
|
||||
}
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@interface Tɐggablɘs
|
||||
{
|
||||
Tɐggablɘ[] value();
|
||||
}
|
||||
|
||||
interface Stylable<Α>
|
||||
{
|
||||
default void ascii$0_() { }
|
||||
default Α μʭʭ$0_() { return null; }
|
||||
}
|
||||
|
||||
// FIELDS.
|
||||
private static final Class<?> CLASS_LOCK = classLock();
|
||||
|
||||
private final Object instanceLock = new Object();
|
||||
|
||||
// CONSTRUCTORS.
|
||||
@Tɐggablɘ @Tɐggablɘ protected Indent2$MethodsTests() { }
|
||||
<T extends Comparable<T>> Indent2$MethodsTests(T t, Void v) { }
|
||||
private <T extends Comparable<T>> Indent2$MethodsTests(T t) { }
|
||||
|
||||
// METHODS.
|
||||
@Tɐggablɘ @Tɐggablɘ abstract void ascii$0_(////////////////
|
||||
);
|
||||
@Tɐggablɘ @Tɐggablɘ abstract <α, β> Τʬ<α> μʭʭ$0_(
|
||||
@SuppressWarnings("bespoke") β b);
|
||||
|
||||
@Tɐggablɘ private native void ascii$1_(/*////////////*/);
|
||||
@Tɐggablɘ private native <α, β> Τʬ<α>[] μʭʭ$1_(
|
||||
java.util.function.Function<β, Τʬ<α>[]> ƒ);
|
||||
|
||||
void Ascii$2_() { }
|
||||
<T, U extends Stylable<T>> void Μʭʭ$2_(U u) { }
|
||||
|
||||
static final native synchronized void ascii$98_();
|
||||
static final native synchronized <α, β> Τʬ<α>[][] μʭʭ$98_(
|
||||
java.util.function.Function<β, Τʬ<α>[][]> ƒ);
|
||||
|
||||
@SuppressWarnings("strictfp")
|
||||
protected static final synchronized strictfp void ascii$99_()
|
||||
{ ascii$98_(); }
|
||||
|
||||
@SuppressWarnings("strictfp")
|
||||
protected static final synchronized strictfp <α, β> Τʬ<α>[] μʭʭ$99_(
|
||||
java.util.function.Function<β, Τʬ<α>[][]> ƒ)
|
||||
{
|
||||
return
|
||||
Indent2$MethodsTests.<α, β>μʭʭ$98_(ƒ)[0];
|
||||
}
|
||||
|
||||
public static Class<?> classLock() { return Indent2$MethodsTests.class; }
|
||||
|
||||
@Override @SuppressWarnings("cast")
|
||||
public String toString() { return (String) "Indent2$MethodsTests"; }
|
||||
}
|
||||
|
||||
enum E2$
|
||||
{
|
||||
@SuppressWarnings("bespoke") A("a"),
|
||||
B("b"
|
||||
/*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/),
|
||||
C("c", new Thread(
|
||||
|
||||
() -> {
|
||||
})), D("d", (java.util.function.BooleanSupplier) () -> true),
|
||||
E("e", new char[] { 'a', 'b', 'c', 'd' }), F("f", new Object() {
|
||||
transient String name = "";
|
||||
@Override public String toString() { return this.name; }
|
||||
}), //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//
|
||||
G("g"), @Deprecated H("h");
|
||||
|
||||
final String s;
|
||||
private E2$(String s) { this.s = s; }
|
||||
private <δ> E2$(String s, δ dummy) { this(s); }
|
||||
|
||||
@Override public String toString() { return name().toUpperCase(); }
|
||||
}
|
||||
@ -84,9 +84,21 @@ abstract class Indent4MethodsTests
|
||||
enum E4
|
||||
{
|
||||
@SuppressWarnings("bespoke") A("a"),
|
||||
B("b"),
|
||||
C("c"), D("d"),
|
||||
E("e"), F("f"), G("g"), H("h");
|
||||
B("b"
|
||||
/*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/),
|
||||
C("c", new Thread(
|
||||
|
||||
() -> {
|
||||
})), D("d", (java.util.function.BooleanSupplier) () -> true),
|
||||
E("e", new char[] { 'a', 'b', 'c', 'd' }), F("f", new Object() {
|
||||
transient String name = "";
|
||||
@Override public String toString() { return this.name; }
|
||||
}), //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//
|
||||
G("g"), @Deprecated H("h");
|
||||
|
||||
final String s;
|
||||
private E4(String s) { this.s = s; }
|
||||
private <δ> E4(String s, δ dummy) { this(s); }
|
||||
|
||||
@Override public String toString() { return name().toUpperCase(); }
|
||||
}
|
||||
|
||||
104
runtime/syntax/testdir/input/java_methods_indent4_signature.java
Normal file
104
runtime/syntax/testdir/input/java_methods_indent4_signature.java
Normal file
@ -0,0 +1,104 @@
|
||||
// VIM_TEST_SETUP let g:java_highlight_functions = 'indent4'
|
||||
// VIM_TEST_SETUP let g:java_highlight_signature = 1
|
||||
// VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
abstract class Indent4$MethodsTests
|
||||
{ // DO NOT retab! THIS FILE; REMEMBER ABOUT testdir/ftplugin.
|
||||
// TYPES.
|
||||
record Τʬ<α>(α a) { }
|
||||
|
||||
enum E
|
||||
{
|
||||
A("a"), B("b"), C("c"), D("d"),
|
||||
E("e"), F("f"), G("g"), H("h");
|
||||
final String s;
|
||||
private E(String s) { this.s = s; }
|
||||
}
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@java.lang.annotation.Repeatable(Tɐggablɘs.class)
|
||||
@interface Tɐggablɘ
|
||||
{
|
||||
String[] value() default "";
|
||||
}
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@interface Tɐggablɘs
|
||||
{
|
||||
Tɐggablɘ[] value();
|
||||
}
|
||||
|
||||
interface Stylable<Α>
|
||||
{
|
||||
default void ascii$0_() { }
|
||||
default Α μʭʭ$0_() { return null; }
|
||||
}
|
||||
|
||||
// FIELDS.
|
||||
private static final Class<?> CLASS_LOCK = classLock();
|
||||
|
||||
private final Object instanceLock = new Object();
|
||||
|
||||
// CONSTRUCTORS.
|
||||
@Tɐggablɘ @Tɐggablɘ protected Indent4$MethodsTests() { }
|
||||
<T extends Comparable<T>> Indent4$MethodsTests(T t, Void v) { }
|
||||
private <T extends Comparable<T>> Indent4$MethodsTests(T t) { }
|
||||
|
||||
// METHODS.
|
||||
@Tɐggablɘ @Tɐggablɘ abstract void ascii$0_(////////////////
|
||||
);
|
||||
@Tɐggablɘ @Tɐggablɘ abstract <α, β> Τʬ<α> μʭʭ$0_(
|
||||
@SuppressWarnings("bespoke") β b);
|
||||
|
||||
@Tɐggablɘ private native void ascii$1_(/*////////////*/);
|
||||
@Tɐggablɘ private native <α, β> Τʬ<α>[] μʭʭ$1_(
|
||||
java.util.function.Function<β, Τʬ<α>[]> ƒ);
|
||||
|
||||
void Ascii$2_() { }
|
||||
<T, U extends Stylable<T>> void Μʭʭ$2_(U u) { }
|
||||
|
||||
static final native synchronized void ascii$98_();
|
||||
static final native synchronized <α, β> Τʬ<α>[][] μʭʭ$98_(
|
||||
java.util.function.Function<β, Τʬ<α>[][]> ƒ);
|
||||
|
||||
@SuppressWarnings("strictfp")
|
||||
protected static final synchronized strictfp void ascii$99_()
|
||||
{ ascii$98_(); }
|
||||
|
||||
@SuppressWarnings("strictfp")
|
||||
protected static final synchronized strictfp <α, β> Τʬ<α>[] μʭʭ$99_(
|
||||
java.util.function.Function<β, Τʬ<α>[][]> ƒ)
|
||||
{
|
||||
return
|
||||
Indent4$MethodsTests.<α, β>μʭʭ$98_(ƒ)[0];
|
||||
}
|
||||
|
||||
public static Class<?> classLock() { return Indent4$MethodsTests.class; }
|
||||
|
||||
@Override @SuppressWarnings("cast")
|
||||
public String toString() { return (String) "Indent4$MethodsTests"; }
|
||||
}
|
||||
|
||||
enum E4$
|
||||
{
|
||||
@SuppressWarnings("bespoke") A("a"),
|
||||
B("b"
|
||||
/*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/),
|
||||
C("c", new Thread(
|
||||
|
||||
() -> {
|
||||
})), D("d", (java.util.function.BooleanSupplier) () -> true),
|
||||
E("e", new char[] { 'a', 'b', 'c', 'd' }), F("f", new Object() {
|
||||
transient String name = "";
|
||||
@Override public String toString() { return this.name; }
|
||||
}), //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//
|
||||
G("g"), @Deprecated H("h");
|
||||
|
||||
final String s;
|
||||
private E4$(String s) { this.s = s; }
|
||||
private <δ> E4$(String s, δ dummy) { this(s); }
|
||||
|
||||
@Override public String toString() { return name().toUpperCase(); }
|
||||
}
|
||||
@ -84,9 +84,21 @@ abstract class Indent8MethodsTests
|
||||
enum E8
|
||||
{
|
||||
@SuppressWarnings("bespoke") A("a"),
|
||||
B("b"),
|
||||
C("c"), D("d"),
|
||||
E("e"), F("f"), G("g"), H("h");
|
||||
B("b"
|
||||
/*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/),
|
||||
C("c", new Thread(
|
||||
|
||||
() -> {
|
||||
})), D("d", (java.util.function.BooleanSupplier) () -> true),
|
||||
E("e", new char[] { 'a', 'b', 'c', 'd' }), F("f", new Object() {
|
||||
transient String name = "";
|
||||
@Override public String toString() { return this.name; }
|
||||
}), //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//
|
||||
G("g"), @Deprecated H("h");
|
||||
|
||||
final String s;
|
||||
private E8(String s) { this.s = s; }
|
||||
private <δ> E8(String s, δ dummy) { this(s); }
|
||||
|
||||
@Override public String toString() { return name().toUpperCase(); }
|
||||
}
|
||||
|
||||
104
runtime/syntax/testdir/input/java_methods_indent8_signature.java
Normal file
104
runtime/syntax/testdir/input/java_methods_indent8_signature.java
Normal file
@ -0,0 +1,104 @@
|
||||
// VIM_TEST_SETUP let g:java_highlight_functions = 'indent8'
|
||||
// VIM_TEST_SETUP let g:java_highlight_signature = 1
|
||||
// VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
abstract class Indent8$MethodsTests
|
||||
{ // DO NOT retab! THIS FILE; REMEMBER ABOUT testdir/ftplugin.
|
||||
// TYPES.
|
||||
record Τʬ<α>(α a) { }
|
||||
|
||||
enum E
|
||||
{
|
||||
A("a"), B("b"), C("c"), D("d"),
|
||||
E("e"), F("f"), G("g"), H("h");
|
||||
final String s;
|
||||
private E(String s) { this.s = s; }
|
||||
}
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@java.lang.annotation.Repeatable(Tɐggablɘs.class)
|
||||
@interface Tɐggablɘ
|
||||
{
|
||||
String[] value() default "";
|
||||
}
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@interface Tɐggablɘs
|
||||
{
|
||||
Tɐggablɘ[] value();
|
||||
}
|
||||
|
||||
interface Stylable<Α>
|
||||
{
|
||||
default void ascii$0_() { }
|
||||
default Α μʭʭ$0_() { return null; }
|
||||
}
|
||||
|
||||
// FIELDS.
|
||||
private static final Class<?> CLASS_LOCK = classLock();
|
||||
|
||||
private final Object instanceLock = new Object();
|
||||
|
||||
// CONSTRUCTORS.
|
||||
@Tɐggablɘ @Tɐggablɘ protected Indent8$MethodsTests() { }
|
||||
<T extends Comparable<T>> Indent8$MethodsTests(T t, Void v) { }
|
||||
private <T extends Comparable<T>> Indent8$MethodsTests(T t) { }
|
||||
|
||||
// METHODS.
|
||||
@Tɐggablɘ @Tɐggablɘ abstract void ascii$0_(////////////////
|
||||
);
|
||||
@Tɐggablɘ @Tɐggablɘ abstract <α, β> Τʬ<α> μʭʭ$0_(
|
||||
@SuppressWarnings("bespoke") β b);
|
||||
|
||||
@Tɐggablɘ private native void ascii$1_(/*////////////*/);
|
||||
@Tɐggablɘ private native <α, β> Τʬ<α>[] μʭʭ$1_(
|
||||
java.util.function.Function<β, Τʬ<α>[]> ƒ);
|
||||
|
||||
void Ascii$2_() { }
|
||||
<T, U extends Stylable<T>> void Μʭʭ$2_(U u) { }
|
||||
|
||||
static final native synchronized void ascii$98_();
|
||||
static final native synchronized <α, β> Τʬ<α>[][] μʭʭ$98_(
|
||||
java.util.function.Function<β, Τʬ<α>[][]> ƒ);
|
||||
|
||||
@SuppressWarnings("strictfp")
|
||||
protected static final synchronized strictfp void ascii$99_()
|
||||
{ ascii$98_(); }
|
||||
|
||||
@SuppressWarnings("strictfp")
|
||||
protected static final synchronized strictfp <α, β> Τʬ<α>[] μʭʭ$99_(
|
||||
java.util.function.Function<β, Τʬ<α>[][]> ƒ)
|
||||
{
|
||||
return
|
||||
Indent8$MethodsTests.<α, β>μʭʭ$98_(ƒ)[0];
|
||||
}
|
||||
|
||||
public static Class<?> classLock() { return Indent8$MethodsTests.class; }
|
||||
|
||||
@Override @SuppressWarnings("cast")
|
||||
public String toString() { return (String) "Indent8$MethodsTests"; }
|
||||
}
|
||||
|
||||
enum E8$
|
||||
{
|
||||
@SuppressWarnings("bespoke") A("a"),
|
||||
B("b"
|
||||
/*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/),
|
||||
C("c", new Thread(
|
||||
|
||||
() -> {
|
||||
})), D("d", (java.util.function.BooleanSupplier) () -> true),
|
||||
E("e", new char[] { 'a', 'b', 'c', 'd' }), F("f", new Object() {
|
||||
transient String name = "";
|
||||
@Override public String toString() { return this.name; }
|
||||
}), //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//
|
||||
G("g"), @Deprecated H("h");
|
||||
|
||||
final String s;
|
||||
private E8$(String s) { this.s = s; }
|
||||
private <δ> E8$(String s, δ dummy) { this(s); }
|
||||
|
||||
@Override public String toString() { return name().toUpperCase(); }
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
// VIM_TEST_SETUP let g:java_highlight_functions = 'style'
|
||||
// VIM_TEST_SETUP let g:java_highlight_signature = 1
|
||||
// VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
abstract class Style$MethodsTests
|
||||
{
|
||||
// TYPES.
|
||||
record Τʬ<α>(α a) { }
|
||||
|
||||
enum E
|
||||
{
|
||||
A("a"), B("b"), C("c"), D("d"),
|
||||
E("e"), F("f"), G("g"), H("h");
|
||||
final String s;
|
||||
private E(String s) { this.s = s; }
|
||||
}
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@java.lang.annotation.Repeatable(Tɐggablɘs.class)
|
||||
@interface Tɐggablɘ
|
||||
{
|
||||
String[] value() default "";
|
||||
}
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@interface Tɐggablɘs
|
||||
{
|
||||
Tɐggablɘ[] value();
|
||||
}
|
||||
|
||||
interface Stylable<Α>
|
||||
{
|
||||
default void ascii$0_() { }
|
||||
default Α μʭʭ$0_() { return null; }
|
||||
}
|
||||
|
||||
// FIELDS.
|
||||
private static final Class<?> CLASS_LOCK = classLock();
|
||||
|
||||
private final Object instanceLock = new Object();
|
||||
|
||||
// CONSTRUCTORS.
|
||||
@Tɐggablɘ @Tɐggablɘ protected Style$MethodsTests() { }
|
||||
<T extends Comparable<T>> Style$MethodsTests(T t, Void v) { }
|
||||
private <T extends Comparable<T>> Style$MethodsTests(T t) { }
|
||||
|
||||
// METHODS.
|
||||
@Tɐggablɘ @Tɐggablɘ abstract void ascii$0_(////////////////
|
||||
);
|
||||
@Tɐggablɘ @Tɐggablɘ abstract <α, β> Τʬ<α> μʭʭ$0_(
|
||||
@SuppressWarnings("bespoke") β b);
|
||||
|
||||
@Tɐggablɘ private native void ascii$1_(/*////////////*/);
|
||||
@Tɐggablɘ private native <α, β> Τʬ<α>[] μʭʭ$1_(
|
||||
java.util.function.Function<β, Τʬ<α>[]> ƒ);
|
||||
|
||||
void Ascii$2_() { }
|
||||
<T, U extends Stylable<T>> void Μʭʭ$2_(U u) { }
|
||||
|
||||
static final native synchronized void ascii$98_();
|
||||
static final native synchronized <α, β> Τʬ<α>[][] μʭʭ$98_(
|
||||
java.util.function.Function<β, Τʬ<α>[][]> ƒ);
|
||||
|
||||
@SuppressWarnings("strictfp")
|
||||
protected static final synchronized strictfp void ascii$99_()
|
||||
{ ascii$98_(); }
|
||||
|
||||
@SuppressWarnings("strictfp")
|
||||
protected static final synchronized strictfp <α, β> Τʬ<α>[] μʭʭ$99_(
|
||||
java.util.function.Function<β, Τʬ<α>[][]> ƒ)
|
||||
{
|
||||
return
|
||||
Style$MethodsTests.<α, β>μʭʭ$98_(ƒ)[0];
|
||||
}
|
||||
|
||||
public static Class<?> classLock() { return Style$MethodsTests.class; }
|
||||
|
||||
@Override @SuppressWarnings("cast")
|
||||
public String toString() { return (String) "Style$MethodsTests"; }
|
||||
}
|
||||
Reference in New Issue
Block a user