Browse Source

Merge branch 'ar/userdiff-java-update'

Userdiff regexp update for Java language.

* ar/userdiff-java-update:
  userdiff: support Java sealed classes
  userdiff: support Java record types
  userdiff: support Java type parameters
maint
Junio C Hamano 2 years ago
parent
commit
4a6e6b0d5b
  1. 6
      t/t4018/java-class-brace-on-separate-line
  2. 6
      t/t4018/java-class-space-before-type-parameters
  3. 6
      t/t4018/java-class-type-parameters
  4. 6
      t/t4018/java-class-type-parameters-implements
  5. 6
      t/t4018/java-interface-type-parameters
  6. 6
      t/t4018/java-interface-type-parameters-extends
  7. 8
      t/t4018/java-non-sealed
  8. 6
      t/t4018/java-record
  9. 6
      t/t4018/java-record-space-before-components
  10. 6
      t/t4018/java-record-type-parameters
  11. 7
      t/t4018/java-sealed
  12. 6
      t/t4018/java-sealed-permits
  13. 6
      t/t4018/java-sealed-type-parameters
  14. 6
      t/t4018/java-sealed-type-parameters-implements-permits
  15. 6
      t/t4018/java-sealed-type-parameters-permits
  16. 4
      userdiff.c

6
t/t4018/java-class-brace-on-separate-line

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
class RIGHT
{
static int ONE;
static int TWO;
static int ChangeMe;
}

6
t/t4018/java-class-space-before-type-parameters

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
class RIGHT <TYPE, PARAMS, AFTER, SPACE> {
static int ONE;
static int TWO;
static int THREE;
private A ChangeMe;
}

6
t/t4018/java-class-type-parameters

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
class RIGHT<A, B> {
static int ONE;
static int TWO;
static int THREE;
private A ChangeMe;
}

6
t/t4018/java-class-type-parameters-implements

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
class RIGHT<A, B> implements List<A> {
static int ONE;
static int TWO;
static int THREE;
private A ChangeMe;
}

6
t/t4018/java-interface-type-parameters

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
interface RIGHT<A, B> {
static int ONE;
static int TWO;
static int THREE;
public B foo(A ChangeMe);
}

6
t/t4018/java-interface-type-parameters-extends

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
interface RIGHT<A, B> extends Function<A, B> {
static int ONE;
static int TWO;
static int THREE;
public B foo(A ChangeMe);
}

8
t/t4018/java-non-sealed

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
public abstract sealed class SealedClass {
public static non-sealed class RIGHT extends SealedClass {
static int ONE;
static int TWO;
static int THREE;
private int ChangeMe;
}
}

6
t/t4018/java-record

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
public record RIGHT(int comp1, double comp2, String comp3) {
static int ONE;
static int TWO;
static int THREE;
static int ChangeMe;
}

6
t/t4018/java-record-space-before-components

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
public record RIGHT (String components, String after, String space) {
static int ONE;
static int TWO;
static int THREE;
static int ChangeMe;
}

6
t/t4018/java-record-type-parameters

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
public record RIGHT<A, N extends Number>(A comp1, N comp2, int comp3) {
static int ONE;
static int TWO;
static int THREE;
static int ChangeMe;
}

7
t/t4018/java-sealed

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
public abstract sealed class Sealed { // RIGHT
static int ONE;
static int TWO;
static int THREE;
public final class ChangeMe extends Sealed {
}
}

6
t/t4018/java-sealed-permits

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
public abstract sealed class RIGHT permits PermittedA, PermittedB {
static int ONE;
static int TWO;
static int THREE;
private int ChangeMe;
}

6
t/t4018/java-sealed-type-parameters

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
public abstract sealed class RIGHT<A, B> {
static int ONE;
static int TWO;
static int THREE;
private int ChangeMe;
}

6
t/t4018/java-sealed-type-parameters-implements-permits

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
public abstract sealed class RIGHT<A, B> implements List<A> permits PermittedA, PermittedB {
static int ONE;
static int TWO;
static int THREE;
private int ChangeMe;
}

6
t/t4018/java-sealed-type-parameters-permits

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
public abstract sealed class RIGHT<A, B> permits PermittedA, PermittedB {
static int ONE;
static int TWO;
static int THREE;
private int ChangeMe;
}

4
userdiff.c

@ -170,8 +170,8 @@ PATTERNS("html", @@ -170,8 +170,8 @@ PATTERNS("html",
"[^<>= \t]+"),
PATTERNS("java",
"!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
/* Class, enum, and interface declarations */
"^[ \t]*(([a-z]+[ \t]+)*(class|enum|interface)[ \t]+[A-Za-z][A-Za-z0-9_$]*[ \t]+.*)$\n"
/* Class, enum, interface, and record declarations */
"^[ \t]*(([a-z-]+[ \t]+)*(class|enum|interface|record)[ \t]+.*)$\n"
/* Method definitions; note that constructor signatures are not */
/* matched because they are indistinguishable from method calls. */
"^[ \t]*(([A-Za-z_<>&][][?&<>.,A-Za-z_0-9]*[ \t]+)+[A-Za-z_][A-Za-z_0-9]*[ \t]*\\([^;]*)$",

Loading…
Cancel
Save