[java] Add support for @ParenthesisDepth in Patterns

This commit is contained in:
Andreas Dangel
2021-07-22 09:56:08 +02:00
parent bccca39dcd
commit 66b642c8c6
12 changed files with 139 additions and 33 deletions

View File

@ -1770,7 +1770,7 @@ void PrimaryPattern() #void:
{}
{
TypePattern()
| "(" Pattern() ")"
| "(" Pattern() ")" { AstImplUtil.bumpParenDepth((ASTPattern) jjtree.peekNode()); }
}
void TypePattern():

View File

@ -21,6 +21,8 @@ import net.sourceforge.pmd.annotation.Experimental;
@Experimental
public final class ASTGuardedPattern extends AbstractJavaNode implements ASTPattern {
private int parenDepth;
ASTGuardedPattern(int id) {
super(id);
}
@ -42,4 +44,14 @@ public final class ASTGuardedPattern extends AbstractJavaNode implements ASTPatt
public JavaNode getGuard() {
return getChild(1);
}
void bumpParenDepth() {
parenDepth++;
}
@Override
@Experimental
public int getParenthesisDepth() {
return parenDepth;
}
}

View File

@ -4,6 +4,8 @@
package net.sourceforge.pmd.lang.java.ast;
import net.sourceforge.pmd.annotation.Experimental;
/**
* A pattern (for pattern matching constructs like {@link ASTInstanceOfExpression InstanceOfExpression}
* or within a {@link ASTSwitchLabel}). This is a JDK 16 feature.
@ -23,4 +25,10 @@ package net.sourceforge.pmd.lang.java.ast;
*/
public interface ASTPattern extends JavaNode {
/**
* Returns the number of parenthesis levels around this pattern.
* If this method returns 0, then no parentheses are present.
*/
@Experimental
int getParenthesisDepth();
}

View File

@ -6,6 +6,8 @@ package net.sourceforge.pmd.lang.java.ast;
import java.util.List;
import net.sourceforge.pmd.annotation.Experimental;
/**
* A type pattern (JDK16). This can be found on
* the right-hand side of an {@link ASTInstanceOfExpression InstanceOfExpression}.
@ -21,6 +23,7 @@ import java.util.List;
public final class ASTTypePattern extends AbstractJavaAnnotatableNode implements ASTPattern {
private boolean isFinal;
private int parenDepth;
ASTTypePattern(int id) {
super(id);
@ -60,4 +63,14 @@ public final class ASTTypePattern extends AbstractJavaAnnotatableNode implements
boolean isFinal() {
return isFinal;
}
void bumpParenDepth() {
parenDepth++;
}
@Override
@Experimental
public int getParenthesisDepth() {
return parenDepth;
}
}

View File

@ -0,0 +1,25 @@
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.java.ast;
/**
* KEEP PRIVATE
*/
final class AstImplUtil {
private AstImplUtil() {
}
static void bumpParenDepth(ASTPattern pattern) {
assert pattern instanceof ASTTypePattern || pattern instanceof ASTGuardedPattern
: pattern.getClass() + " doesn't have parenDepth attribute!";
if (pattern instanceof ASTTypePattern) {
((ASTTypePattern) pattern).bumpParenDepth();
} else if (pattern instanceof ASTGuardedPattern) {
((ASTGuardedPattern) pattern).bumpParenDepth();
}
}
}

View File

@ -40,7 +40,7 @@
| | | +- PrimaryExpression[]
| | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | | +- Name[@Image = "obj"]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -150,7 +150,7 @@
| | | +- PrimaryExpression[]
| | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | | +- Name[@Image = "obj"]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -216,7 +216,7 @@
| | | | +- PrimaryExpression[]
| | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | | | +- Name[@Image = "obj"]
| | | | +- TypePattern[]
| | | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -265,7 +265,7 @@
| | | | +- PrimaryExpression[]
| | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | | | +- Name[@Image = "obj"]
| | | | +- TypePattern[]
| | | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -313,7 +313,7 @@
| | | +- PrimaryExpression[]
| | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | | +- Name[@Image = "obj"]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -378,7 +378,7 @@
| | | +- PrimaryExpression[]
| | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | | +- Name[@Image = "obj"]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Annotation[@AnnotationName = "Deprecated"]
| | | | +- MarkerAnnotation[@AnnotationName = "Deprecated"]
| | | | +- Name[@Image = "Deprecated"]
@ -446,7 +446,7 @@
| | +- PrimaryExpression[]
| | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | +- Name[@Image = "obj"]
| | +- TypePattern[]
| | +- TypePattern[@ParenthesisDepth = 0]
| | +- Annotation[@AnnotationName = "Deprecated"]
| | | +- MarkerAnnotation[@AnnotationName = "Deprecated"]
| | | +- Name[@Image = "Deprecated"]

View File

@ -36,7 +36,7 @@
| | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = ""null!"", @FloatLiteral = false, @Image = ""null!"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = ""null!"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -95,7 +95,7 @@
| | +- Arguments[@ArgumentCount = 0, @Size = 0]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -117,7 +117,7 @@
| | +- Name[@Image = "s"]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false]
@ -167,7 +167,7 @@
| | +- SwitchLabel[@Default = false]
| | | +- NullLiteral[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -215,7 +215,7 @@
| | +- SwitchLabeledExpression[]
| | | +- SwitchLabel[@Default = false]
| | | | +- NullLiteral[]
| | | | +- TypePattern[]
| | | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]

View File

@ -36,7 +36,7 @@
| | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = ""null"", @FloatLiteral = false, @Image = ""null"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = ""null"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| | +- SwitchLabeledExpression[]
| | | +- SwitchLabel[@Default = false]
| | | | +- TypePattern[]
| | | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -54,7 +54,7 @@
| | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = ""String"", @FloatLiteral = false, @Image = ""String"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = ""String"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| | +- SwitchLabeledExpression[]
| | | +- SwitchLabel[@Default = false]
| | | | +- TypePattern[]
| | | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true]
@ -82,7 +82,7 @@
| | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "" values"", @FloatLiteral = false, @Image = "" values"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "" values"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| | +- SwitchLabeledExpression[]
| | | +- SwitchLabel[@Default = false]
| | | | +- TypePattern[]
| | | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false]
@ -106,7 +106,7 @@
| | | +- Arguments[@ArgumentCount = 0, @Size = 0]
| | +- SwitchLabeledExpression[]
| | | +- SwitchLabel[@Default = false]
| | | | +- TypePattern[]
| | | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "int"]
| | | | | +- ReferenceType[@Array = true, @ArrayDepth = 1]
| | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"]

View File

@ -13,6 +13,8 @@ public class GuardedAndParenthesizedPatterns {
case String s && (s.length() == 1) -> System.out.println("single char string");
case String s -> System.out.println("string");
case (Integer i && i.intValue() == 1) -> System.out.println("integer 1");
case (((Long l && l.longValue() == 1L))) -> System.out.println("long 1 with parens");
case (((Double d))) -> System.out.println("double with parens");
default -> System.out.println("default case");
}
}

View File

@ -22,8 +22,8 @@
| | +- Name[@Image = "o"]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- GuardedPattern[]
| | | +- TypePattern[]
| | | +- GuardedPattern[@ParenthesisDepth = 0]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -53,7 +53,7 @@
| | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = ""single char string"", @FloatLiteral = false, @Image = ""single char string"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = ""single char string"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -71,8 +71,8 @@
| | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = ""string"", @FloatLiteral = false, @Image = ""string"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = ""string"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- GuardedPattern[]
| | | +- TypePattern[]
| | | +- GuardedPattern[@ParenthesisDepth = 1]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false]
@ -98,6 +98,52 @@
| | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = ""integer 1"", @FloatLiteral = false, @Image = ""integer 1"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = ""integer 1"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- GuardedPattern[@ParenthesisDepth = 3]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Long"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Long", @ReferenceToClassSameCompilationUnit = false]
| | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "l"]
| | | +- EqualityExpression[@Image = "==", @Operator = "=="]
| | | +- PrimaryExpression[]
| | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | | | +- Name[@Image = "l.longValue"]
| | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false]
| | | | +- Arguments[@ArgumentCount = 0, @Size = 0]
| | | +- PrimaryExpression[]
| | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1L", @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @LongLiteral = true, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1L", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1]
| | +- Expression[@StandAlonePrimitive = false]
| | +- PrimaryExpression[]
| | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | +- Name[@Image = "System.out.println"]
| | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false]
| | +- Arguments[@ArgumentCount = 1, @Size = 1]
| | +- ArgumentList[@Size = 1]
| | +- Expression[@StandAlonePrimitive = false]
| | +- PrimaryExpression[]
| | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = ""long 1 with parens"", @FloatLiteral = false, @Image = ""long 1 with parens"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = ""long 1 with parens"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[@ParenthesisDepth = 3]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Double"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Double", @ReferenceToClassSameCompilationUnit = false]
| | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"]
| | +- Expression[@StandAlonePrimitive = false]
| | +- PrimaryExpression[]
| | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | +- Name[@Image = "System.out.println"]
| | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false]
| | +- Arguments[@ArgumentCount = 1, @Size = 1]
| | +- ArgumentList[@Size = 1]
| | +- Expression[@StandAlonePrimitive = false]
| | +- PrimaryExpression[]
| | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = ""double with parens"", @FloatLiteral = false, @Image = ""double with parens"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = ""double with parens"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| +- SwitchLabeledExpression[]
| +- SwitchLabel[@Default = true]
| +- Expression[@StandAlonePrimitive = false]
| +- PrimaryExpression[]
@ -130,7 +176,7 @@
| | | | +- PrimaryExpression[]
| | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | | | +- Name[@Image = "o"]
| | | | +- TypePattern[]
| | | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -180,7 +226,7 @@
| | | | +- PrimaryExpression[]
| | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | | | +- Name[@Image = "o"]
| | | | +- TypePattern[]
| | | | +- TypePattern[@ParenthesisDepth = 0]
| | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]
@ -217,8 +263,8 @@
| | +- PrimaryExpression[]
| | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | | +- Name[@Image = "o"]
| | +- GuardedPattern[]
| | +- TypePattern[]
| | +- GuardedPattern[@ParenthesisDepth = 1]
| | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]

View File

@ -41,7 +41,7 @@
| | +- Name[@Image = "o"]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false]
@ -63,7 +63,7 @@
| | +- Name[@Image = "i"]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Long"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Long", @ReferenceToClassSameCompilationUnit = false]
@ -85,7 +85,7 @@
| | +- Name[@Image = "l"]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Double"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Double", @ReferenceToClassSameCompilationUnit = false]
@ -107,7 +107,7 @@
| | +- Name[@Image = "d"]
| +- SwitchLabeledExpression[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false]

View File

@ -22,7 +22,7 @@
| | +- Name[@Image = "o"]
| +- SwitchLabeledBlock[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Character"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Character", @ReferenceToClassSameCompilationUnit = false]
@ -71,7 +71,7 @@
| | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = ""Character"", @FloatLiteral = false, @Image = ""Character"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = ""Character"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0]
| +- SwitchLabeledThrowStatement[]
| | +- SwitchLabel[@Default = false]
| | | +- TypePattern[]
| | | +- TypePattern[@ParenthesisDepth = 0]
| | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"]
| | | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false]
@ -119,7 +119,7 @@
| | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
| | +- Name[@Image = "o"]
| +- SwitchLabel[@Default = false]
| | +- TypePattern[]
| | +- TypePattern[@ParenthesisDepth = 0]
| | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Character"]
| | | +- ReferenceType[@Array = false, @ArrayDepth = 0]
| | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Character", @ReferenceToClassSameCompilationUnit = false]