From e373663a85175cba97e8ed3ff4e4e9d60aa1039c Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Tue, 18 Sep 2012 20:41:07 +0400 Subject: [PATCH] Tuple-related classes are deprecated #KT-2358 In Progress --- compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java | 6 ++++++ .../jetbrains/jet/lang/parsing/JetExpressionParsing.java | 1 + .../src/org/jetbrains/jet/lang/parsing/JetParsing.java | 1 + .../src/org/jetbrains/jet/lang/psi/JetTupleExpression.java | 4 ++++ .../src/org/jetbrains/jet/lang/psi/JetTupleType.java | 4 ++++ .../frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java | 2 ++ .../src/org/jetbrains/jet/lang/psi/JetVisitorVoid.java | 2 ++ .../jet/plugin/quickfix/MigrateTuplesInProjectFix.java | 1 + 8 files changed, 21 insertions(+) diff --git a/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java b/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java index a54b8e46855..823c7e204a9 100644 --- a/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java +++ b/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java @@ -64,10 +64,15 @@ public interface JetNodeTypes { JetNodeType VALUE_ARGUMENT = new JetNodeType("VALUE_ARGUMENT", JetValueArgument.class); JetNodeType VALUE_ARGUMENT_NAME = new JetNodeType("VALUE_ARGUMENT_NAME", JetValueArgumentName.class); JetNodeType TYPE_REFERENCE = new JetNodeType("TYPE_REFERENCE", JetTypeReference.class); + + @Deprecated // Tuples are to be removed in Kotlin M4 JetNodeType LABELED_TUPLE_ENTRY = new JetNodeType("LABELED_TUPLE_ENTRY"); + @Deprecated // Tuples are to be removed in Kotlin M4 JetNodeType LABELED_TUPLE_TYPE_ENTRY = new JetNodeType("LABELED_TUPLE_TYPE_ENTRY"); JetNodeType USER_TYPE = new JetNodeType("USER_TYPE", JetUserType.class); + + @Deprecated // Tuples are to be removed in Kotlin M4 JetNodeType TUPLE_TYPE = new JetNodeType("TUPLE_TYPE", JetTupleType.class); JetNodeType FUNCTION_TYPE = new JetNodeType("FUNCTION_TYPE", JetFunctionType.class); JetNodeType SELF_TYPE = new JetNodeType("SELF_TYPE", JetSelfType.class); @@ -95,6 +100,7 @@ public interface JetNodeTypes { JetNodeType LITERAL_STRING_TEMPLATE_ENTRY = new JetNodeType("LITERAL_STRING_TEMPLATE_ENTRY", JetLiteralStringTemplateEntry.class); JetNodeType ESCAPE_STRING_TEMPLATE_ENTRY = new JetNodeType("ESCAPE_STRING_TEMPLATE_ENTRY", JetEscapeStringTemplateEntry.class); + @Deprecated // Tuples are to be removed in Kotlin M4 JetNodeType TUPLE = new JetNodeType("TUPLE", JetTupleExpression.class); JetNodeType PARENTHESIZED = new JetNodeType("PARENTHESIZED", JetParenthesizedExpression.class); JetNodeType RETURN = new JetNodeType("RETURN", JetReturnExpression.class); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java index 52fed0377c7..9f6affc057d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java @@ -1591,6 +1591,7 @@ public class JetExpressionParsing extends AbstractJetParsing { * : "#" "(" (((SimpleName "=")? expression){","})? ")" * ; */ + @Deprecated // Tuples are to be removed in Kotlin M4 private void parseTupleExpression() { assert _at(HASH); PsiBuilder.Marker mark = mark(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java index 7dcf6c310b8..1d06761468e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java @@ -1564,6 +1564,7 @@ public class JetParsing extends AbstractJetParsing { * : "#" "(" parameter{","} ")" // tuple with named entries, the names do not affect assignment compatibility * ; */ + @Deprecated // Tuples are to be removed in Kotlin M4 private void parseTupleType() { assert _at(HASH); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTupleExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTupleExpression.java index c6212f6d536..dca8595ce39 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTupleExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTupleExpression.java @@ -25,7 +25,10 @@ import java.util.List; /** * @author max */ +@Deprecated // Tuples are to be removed in Kotlin M4 public class JetTupleExpression extends JetExpressionImpl { + + @Deprecated // Tuples are to be removed in Kotlin M4 public JetTupleExpression(@NotNull ASTNode node) { super(node); } @@ -40,6 +43,7 @@ public class JetTupleExpression extends JetExpressionImpl { return visitor.visitTupleExpression(this, data); } + @Deprecated // Tuples are to be removed in Kotlin M4 public List getEntries() { return PsiTreeUtil.getChildrenOfTypeAsList(this, JetExpression.class); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTupleType.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTupleType.java index 872d7ae19a5..a4b71278e6c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTupleType.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTupleType.java @@ -25,7 +25,10 @@ import java.util.List; /** * @author max */ +@Deprecated // Tuples are to be removed in Kotlin M4 public class JetTupleType extends JetTypeElement { + + @Deprecated // Tuples are to be removed in Kotlin M4 public JetTupleType(@NotNull ASTNode node) { super(node); } @@ -47,6 +50,7 @@ public class JetTupleType extends JetTypeElement { } @NotNull + @Deprecated // Tuples are to be removed in Kotlin M4 public List getComponentTypeRefs() { return findChildrenByType(JetNodeTypes.TYPE_REFERENCE); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java index 9a3e8a026df..fe9bda0f82b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java @@ -168,6 +168,7 @@ public class JetVisitor extends PsiElementVisitor { return visitExpression(expression, data); } + @Deprecated // Tuples are to be removed in Kotlin M4 public R visitTupleExpression(JetTupleExpression expression, D data) { return visitExpression(expression, data); } @@ -336,6 +337,7 @@ public class JetVisitor extends PsiElementVisitor { return visitTypeElement(type, data); } + @Deprecated // Tuples are to be removed in Kotlin M4 public R visitTupleType(JetTupleType type, D data) { return visitTypeElement(type, data); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitorVoid.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitorVoid.java index b1aafd75e77..0092d06c5e0 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitorVoid.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitorVoid.java @@ -158,6 +158,7 @@ public class JetVisitorVoid extends PsiElementVisitor { visitExpression(expression); } + @Deprecated // Tuples are to be removed in Kotlin M4 public void visitTupleExpression(JetTupleExpression expression) { visitExpression(expression); } @@ -325,6 +326,7 @@ public class JetVisitorVoid extends PsiElementVisitor { visitTypeElement(type); } + @Deprecated // Tuples are to be removed in Kotlin M4 public void visitTupleType(JetTupleType type) { visitTypeElement(type); } diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/MigrateTuplesInProjectFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/MigrateTuplesInProjectFix.java index 8f646dbc466..8115c0e5d18 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/MigrateTuplesInProjectFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/MigrateTuplesInProjectFix.java @@ -47,6 +47,7 @@ import java.util.Collections; /** * @author abreslav */ +@Deprecated // Tuples are to be removed in Kotlin M4 public class MigrateTuplesInProjectFix extends JetIntentionAction { public MigrateTuplesInProjectFix(@NotNull PsiElement element) { super(element);