From 25b71cd6c900d51e38866dc4bb3cfd8e77ebad7c Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Wed, 25 Jan 2012 17:00:30 +0400 Subject: [PATCH 01/11] suite.addTestSuite(class) won't work if passed TestCase instance has TestCase.class loaded by different classloader. It does so very silently (this is a note to reified generics haters) --- .../tests/org/jetbrains/jet/codegen/TestlibTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java b/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java index 096238cc509..525ab1594c1 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java @@ -74,11 +74,10 @@ public class TestlibTest extends CodegenTestCase { ClassFileFactory classFileFactory = session.generate(); - URLClassLoader dependenciesClassLoader = new URLClassLoader(new URL[] { junitJar.toURI().toURL() }); - GeneratedClassLoader loader; - URLClassLoader parentClassLoader = new URLClassLoader(new URL[]{ - ForTestCompileStdlib.stdlibJarForTests().toURI().toURL()}, dependenciesClassLoader); - loader = new GeneratedClassLoader(classFileFactory, parentClassLoader); + GeneratedClassLoader loader = new GeneratedClassLoader( + classFileFactory, + new URLClassLoader(new URL[]{ForTestCompileStdlib.stdlibJarForTests().toURI().toURL(), junitJar.toURI().toURL()}, + TestCase.class.getClassLoader())); JetTypeMapper typeMapper = new JetTypeMapper(classFileFactory.state.getStandardLibrary(), session.getMyBindingContext()); TestSuite suite = new TestSuite("StandardLibrary"); From 9421475ef4be4c28275f026a07382ad02c04a12b Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 25 Jan 2012 17:26:37 +0400 Subject: [PATCH 02/11] Swing builder example (started) --- examples/src/swing/SwingBuilder.kt | 80 ++++++++++++++++++++++++++ examples/src/swing/SwingBuilderTest.kt | 29 ++++++++++ 2 files changed, 109 insertions(+) create mode 100644 examples/src/swing/SwingBuilder.kt create mode 100644 examples/src/swing/SwingBuilderTest.kt diff --git a/examples/src/swing/SwingBuilder.kt b/examples/src/swing/SwingBuilder.kt new file mode 100644 index 00000000000..3fc7cf72bc7 --- /dev/null +++ b/examples/src/swing/SwingBuilder.kt @@ -0,0 +1,80 @@ +package kool.swing + +import javax.swing.* +import java.awt.* +import java.awt.event.* + +var Container.south : JComponent + get() = throw UnsupportedOperationException() + set(comp) {add(comp, BorderLayout.SOUTH)} + +var Container.north : JComponent + get() = throw UnsupportedOperationException() + set(comp) {add(comp, BorderLayout.NORTH)} + +var Container.east : JComponent + get() = throw UnsupportedOperationException() + set(comp) {add(comp, BorderLayout.EAST)} + +var Container.west : JComponent + get() = throw UnsupportedOperationException() + set(comp) {add(comp, BorderLayout.WEST)} + +var Container.center : JComponent + get() = throw UnsupportedOperationException() + set(comp) {add(comp, BorderLayout.CENTER)} + +class KFrame(title : String, init : KFrame.() -> Unit) : JFrame(title) { + { + this.init() + } + + fun T.toSouth() : T { + this@KFrame.add(this, BorderLayout.SOUTH) + return this + } +} + + +fun JPanel(init : JPanel.() -> Unit) : JPanel { + val p = JPanel() + p.init() + return p +} + +//fun KFrame(title : String, init : JFrame.() -> Unit) : JFrame { +// val result = JFrame(title) +// result.init() +// return result +//} + +fun JButton(text : String, action : (ActionEvent) -> Unit) : JButton { + val result = JButton(text) + result.addActionListener(object : ActionListener { + override fun actionPerformed(e: ActionEvent?) { + action(e.sure()) + } + }) + return result +} + +var JFrame.title : String + get() = getTitle().sure() + set(t) {setTitle(t)} + +var JFrame.size : #(Int, Int) + get() = #(getSize().sure().getWidth().int, getSize().sure().getHeight().int) + set(dim) {setSize(Dimension(dim._1, dim._2))} + +var JFrame.height : Int + get() = getSize().sure().getHeight().int + set(h) {setSize(width, h)} + +var JFrame.width : Int + get() = getSize().sure().getWidth().int + set(w) {setSize(height, w)} + +var JFrame.defaultCloseOperation : Int + get() = getDefaultCloseOperation() + set(def) {setDefaultCloseOperation(def)} + diff --git a/examples/src/swing/SwingBuilderTest.kt b/examples/src/swing/SwingBuilderTest.kt new file mode 100644 index 00000000000..b8030408b03 --- /dev/null +++ b/examples/src/swing/SwingBuilderTest.kt @@ -0,0 +1,29 @@ +package demo + +import kool.swing.* +import javax.swing.* + +val greeting = "Hello,\n\nEnter some text here!" + +fun main(args : Array) { + KFrame("Demo") { + height = 100 + width = 100 + defaultCloseOperation = JFrame.EXIT_ON_CLOSE + + val text = JTextArea(greeting) + center = text + + val southPanel = JPanel { + west = JButton("Clear") { + text.setText("") + } + + east = JButton("Restore") { + text.setText(greeting) + } + } + + }.show() + +} \ No newline at end of file From 79d5c2e3ed2e9a4dec4a737db2cd67d8519cf646 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Wed, 25 Jan 2012 17:32:59 +0400 Subject: [PATCH 03/11] Remove "ref" and "default" keywords from completion. Start using tokens for getting keyword completion constants. --- .../JetKeywordCompletionContributor.java | 65 ++++++++++++++----- .../completion/keywords/InFunctionScope.kt | 2 - .../completion/keywords/InParametersList.kt | 2 - .../completion/keywords/InTypeScope.kt | 2 - 4 files changed, 49 insertions(+), 22 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/completion/JetKeywordCompletionContributor.java b/idea/src/org/jetbrains/jet/plugin/completion/JetKeywordCompletionContributor.java index af001ad3809..0e6b5eb5570 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/JetKeywordCompletionContributor.java +++ b/idea/src/org/jetbrains/jet/plugin/completion/JetKeywordCompletionContributor.java @@ -18,12 +18,16 @@ import com.intellij.psi.util.PsiTreeUtil; import com.intellij.util.ProcessingContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.psi.*; +import org.jetbrains.jet.lexer.JetToken; import org.jetbrains.jet.plugin.completion.handlers.JetFunctionInsertHandler; import org.jetbrains.jet.plugin.completion.handlers.JetKeywordInsertHandler; +import java.util.ArrayList; import java.util.Collection; import java.util.List; +import static org.jetbrains.jet.lexer.JetTokens.*; + /** * A keyword contributor for Kotlin * @@ -42,7 +46,7 @@ public class JetKeywordCompletionContributor extends CompletionContributor { new LeftNeighbour(new TextFilter(".")) )); - private final static List FUNCTION_KEYWORDS = Lists.newArrayList("get", "set"); + private final static List FUNCTION_KEYWORDS = Lists.newArrayList(GET_KEYWORD.toString(), SET_KEYWORD.toString()); private static class CommentFilter implements ElementFilter { @Override @@ -169,29 +173,58 @@ public class JetKeywordCompletionContributor extends CompletionContributor { public JetKeywordCompletionContributor() { registerScopeKeywordsCompletion(new InTopFilter(), - "abstract", "class", "enum", "final", "fun", "get", "import", "inline", - "internal", "open", "package", "private", "protected", "public", "set", - "trait", "type", "val", "var"); + ABSTRACT_KEYWORD, CLASS_KEYWORD, ENUM_KEYWORD, + FINAL_KEYWORD, FUN_KEYWORD, GET_KEYWORD, + IMPORT_KEYWORD, INLINE_KEYWORD, INTERNAL_KEYWORD, + OPEN_KEYWORD, PACKAGE_KEYWORD, PRIVATE_KEYWORD, + PROTECTED_KEYWORD, PUBLIC_KEYWORD, SET_KEYWORD, + TRAIT_KEYWORD, TYPE_KEYWORD, VAL_KEYWORD, + VAR_KEYWORD); registerScopeKeywordsCompletion(new InClassBodyFilter(), - "abstract", "class", "enum", "final", "fun", "get", "inline", "internal", - "object", "open", "override", "private", "protected", "public", "set", "trait", - "type", "val", "var"); + ABSTRACT_KEYWORD, CLASS_KEYWORD, ENUM_KEYWORD, + FINAL_KEYWORD, FUN_KEYWORD, GET_KEYWORD, + INLINE_KEYWORD, INTERNAL_KEYWORD, OBJECT_KEYWORD, + OPEN_KEYWORD, OVERRIDE_KEYWORD, PRIVATE_KEYWORD, + PROTECTED_KEYWORD, PUBLIC_KEYWORD, SET_KEYWORD, + TRAIT_KEYWORD, TYPE_KEYWORD, VAL_KEYWORD, + VAR_KEYWORD); registerScopeKeywordsCompletion(new InNonClassBlockFilter(), - "as", "break", "by", "catch", "class", "continue", "default", "do", "else", - "enum", "false", "finally", "for", "fun", "get", "if", "in", "inline", - "internal", "is", "null", "object", "private", "protected", "public", "ref", - "return", "set", "super", "This", "this", "throw", "trait", "true", "try", - "type", "val", "var", "vararg", "when", "where", "while"); + AS_KEYWORD, BREAK_KEYWORD, BY_KEYWORD, + CATCH_KEYWORD, CLASS_KEYWORD, CONTINUE_KEYWORD, + DO_KEYWORD, ELSE_KEYWORD, ENUM_KEYWORD, + FALSE_KEYWORD, FINALLY_KEYWORD, FOR_KEYWORD, + FUN_KEYWORD, GET_KEYWORD, IF_KEYWORD, + IN_KEYWORD, INLINE_KEYWORD, INTERNAL_KEYWORD, + IS_KEYWORD, NULL_KEYWORD, OBJECT_KEYWORD, + PRIVATE_KEYWORD, PROTECTED_KEYWORD, PUBLIC_KEYWORD, + RETURN_KEYWORD, SET_KEYWORD, SUPER_KEYWORD, + CAPITALIZED_THIS_KEYWORD, THIS_KEYWORD, THROW_KEYWORD, + TRAIT_KEYWORD, TRUE_KEYWORD, TRY_KEYWORD, + TYPE_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, + VARARG_KEYWORD, WHEN_KEYWORD, WHERE_KEYWORD, + WHILE_KEYWORD); - registerScopeKeywordsCompletion(new InPropertyFilter(), "else", "false", "if", "null", "this", "true"); + registerScopeKeywordsCompletion(new InPropertyFilter(), + ELSE_KEYWORD, FALSE_KEYWORD, IF_KEYWORD, + NULL_KEYWORD, THIS_KEYWORD, TRUE_KEYWORD); - registerScopeKeywordsCompletion(new InParametersFilter(), "ref", "out"); + registerScopeKeywordsCompletion(new InParametersFilter(), OUT_KEYWORD); } - private void registerScopeKeywordsCompletion(final ElementFilter placeFilter, String... keywords) { - extend(CompletionType.BASIC, getPlacePattern(placeFilter), new KeywordsCompletionProvider(keywords)); + private void registerScopeKeywordsCompletion(final ElementFilter placeFilter, JetToken... keywords) { + extend(CompletionType.BASIC, getPlacePattern(placeFilter), + new KeywordsCompletionProvider(convertTokensToStrings(keywords))); + } + + private static String[] convertTokensToStrings(JetToken... keywords) { + final ArrayList strings = new ArrayList(keywords.length); + for (JetToken keyword : keywords) { + strings.add(keyword.toString()); + } + + return strings.toArray(new String[strings.size()]); } private static ElementPattern getPlacePattern(final ElementFilter placeFilter) { diff --git a/idea/testData/completion/keywords/InFunctionScope.kt b/idea/testData/completion/keywords/InFunctionScope.kt index 1f51914c8e1..9e3f6aebb2b 100644 --- a/idea/testData/completion/keywords/InFunctionScope.kt +++ b/idea/testData/completion/keywords/InFunctionScope.kt @@ -10,7 +10,6 @@ fun foo() { // EXIST: catch // EXIST: class // EXIST: continue -// EXIST: default // EXIST: do // EXIST: else // EXIST: enum @@ -35,7 +34,6 @@ fun foo() { // EXIST: private // EXIST: protected // EXIST: public -// EXIST: ref // EXIST: return // EXIST: set // EXIST: super diff --git a/idea/testData/completion/keywords/InParametersList.kt b/idea/testData/completion/keywords/InParametersList.kt index 38b0beec93c..936832f8078 100644 --- a/idea/testData/completion/keywords/InParametersList.kt +++ b/idea/testData/completion/keywords/InParametersList.kt @@ -10,7 +10,6 @@ fun test() { // ABSENT: catch // ABSENT: class // ABSENT: continue -// ABSENT: default // ABSENT: do // ABSENT: else // ABSENT: enum @@ -35,7 +34,6 @@ fun test() { // ABSENT: private // ABSENT: protected // ABSENT: public -// EXIST: ref // ABSENT: return // ABSENT: set // ABSENT: super diff --git a/idea/testData/completion/keywords/InTypeScope.kt b/idea/testData/completion/keywords/InTypeScope.kt index e83a1f01f90..71218fbdc50 100644 --- a/idea/testData/completion/keywords/InTypeScope.kt +++ b/idea/testData/completion/keywords/InTypeScope.kt @@ -10,7 +10,6 @@ fun foo() { // EXIST: catch // EXIST: class // EXIST: continue -// EXIST: default // EXIST: do // EXIST: else // EXIST: enum @@ -35,7 +34,6 @@ fun foo() { // EXIST: private // EXIST: protected // EXIST: public -// EXIST: ref // EXIST: return // EXIST: set // EXIST: super From a63989f00337816db7af5b8de1e0172b0e6f3d46 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Wed, 25 Jan 2012 18:22:54 +0400 Subject: [PATCH 04/11] Download (and attach to respectful libraries) sources for IDEA CE --- .idea/libraries/idea_full.xml | 150 +++++++++++++++++++++++++++++- .idea/libraries/intellij_core.xml | 56 ++++++++++- update_dependencies.xml | 3 + 3 files changed, 207 insertions(+), 2 deletions(-) diff --git a/.idea/libraries/idea_full.xml b/.idea/libraries/idea_full.xml index 30b7644b98f..9c83e5185c0 100644 --- a/.idea/libraries/idea_full.xml +++ b/.idea/libraries/idea_full.xml @@ -4,7 +4,155 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/intellij_core.xml b/.idea/libraries/intellij_core.xml index d14331541a7..a019534fb03 100644 --- a/.idea/libraries/intellij_core.xml +++ b/.idea/libraries/intellij_core.xml @@ -4,7 +4,61 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/update_dependencies.xml b/update_dependencies.xml index b79e133604a..97628414f9b 100644 --- a/update_dependencies.xml +++ b/update_dependencies.xml @@ -32,6 +32,9 @@ + + + From 3e29aad6dd1bb5909c5dd94682c2f586b1e699aa Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 25 Jan 2012 15:29:48 +0400 Subject: [PATCH 05/11] KT-987 Unboxing_nulls: Kotlinized versions of basic Java collections --- jdk-headers/.idea/.name | 1 + jdk-headers/.idea/ant.xml | 7 + .../.idea/artifacts/jdk_headers_jar.xml | 13 ++ jdk-headers/.idea/compiler.xml | 21 +++ .../.idea/copyright/profiles_settings.xml | 5 + jdk-headers/.idea/encodings.xml | 5 + jdk-headers/.idea/misc.xml | 10 ++ jdk-headers/.idea/modules.xml | 10 ++ jdk-headers/.idea/scopes/scope_settings.xml | 5 + jdk-headers/.idea/uiDesigner.xml | 125 ++++++++++++++++++ jdk-headers/.idea/vcs.xml | 7 + jdk-headers/jdk-headers.iml | 12 ++ jdk-headers/src/META-INF/MANIFEST.MF | 2 + jdk-headers/src/java/lang/Iterable.kt | 5 + .../src/java/util/AbstractCollection.kt | 17 +++ jdk-headers/src/java/util/AbstractList.kt | 20 +++ jdk-headers/src/java/util/AbstractMap.kt | 21 +++ .../src/java/util/AbstractSequentialList.kt | 10 ++ jdk-headers/src/java/util/AbstractSet.kt | 6 + jdk-headers/src/java/util/ArrayList.kt | 38 ++++++ jdk-headers/src/java/util/Collection.kt | 20 +++ jdk-headers/src/java/util/Deque.kt | 30 +++++ jdk-headers/src/java/util/Enumeration.kt | 5 + jdk-headers/src/java/util/HashMap.kt | 24 ++++ jdk-headers/src/java/util/HashSet.kt | 40 ++++++ jdk-headers/src/java/util/Iterator.kt | 7 + jdk-headers/src/java/util/LinkedHashMap.kt | 34 +++++ jdk-headers/src/java/util/LinkedHashSet.kt | 10 ++ jdk-headers/src/java/util/LinkedList.kt | 54 ++++++++ jdk-headers/src/java/util/List.kt | 29 ++++ jdk-headers/src/java/util/Map.kt | 28 ++++ jdk-headers/src/java/util/Queue.kt | 9 ++ jdk-headers/src/java/util/Set.kt | 20 +++ jdk-headers/test/test.iml | 13 ++ 34 files changed, 663 insertions(+) create mode 100644 jdk-headers/.idea/.name create mode 100644 jdk-headers/.idea/ant.xml create mode 100644 jdk-headers/.idea/artifacts/jdk_headers_jar.xml create mode 100644 jdk-headers/.idea/compiler.xml create mode 100644 jdk-headers/.idea/copyright/profiles_settings.xml create mode 100644 jdk-headers/.idea/encodings.xml create mode 100644 jdk-headers/.idea/misc.xml create mode 100644 jdk-headers/.idea/modules.xml create mode 100644 jdk-headers/.idea/scopes/scope_settings.xml create mode 100644 jdk-headers/.idea/uiDesigner.xml create mode 100644 jdk-headers/.idea/vcs.xml create mode 100644 jdk-headers/jdk-headers.iml create mode 100644 jdk-headers/src/META-INF/MANIFEST.MF create mode 100644 jdk-headers/src/java/lang/Iterable.kt create mode 100644 jdk-headers/src/java/util/AbstractCollection.kt create mode 100644 jdk-headers/src/java/util/AbstractList.kt create mode 100644 jdk-headers/src/java/util/AbstractMap.kt create mode 100644 jdk-headers/src/java/util/AbstractSequentialList.kt create mode 100644 jdk-headers/src/java/util/AbstractSet.kt create mode 100644 jdk-headers/src/java/util/ArrayList.kt create mode 100644 jdk-headers/src/java/util/Collection.kt create mode 100644 jdk-headers/src/java/util/Deque.kt create mode 100644 jdk-headers/src/java/util/Enumeration.kt create mode 100644 jdk-headers/src/java/util/HashMap.kt create mode 100644 jdk-headers/src/java/util/HashSet.kt create mode 100644 jdk-headers/src/java/util/Iterator.kt create mode 100644 jdk-headers/src/java/util/LinkedHashMap.kt create mode 100644 jdk-headers/src/java/util/LinkedHashSet.kt create mode 100644 jdk-headers/src/java/util/LinkedList.kt create mode 100644 jdk-headers/src/java/util/List.kt create mode 100644 jdk-headers/src/java/util/Map.kt create mode 100644 jdk-headers/src/java/util/Queue.kt create mode 100644 jdk-headers/src/java/util/Set.kt create mode 100644 jdk-headers/test/test.iml diff --git a/jdk-headers/.idea/.name b/jdk-headers/.idea/.name new file mode 100644 index 00000000000..afd94ca02dc --- /dev/null +++ b/jdk-headers/.idea/.name @@ -0,0 +1 @@ +jdk-headers \ No newline at end of file diff --git a/jdk-headers/.idea/ant.xml b/jdk-headers/.idea/ant.xml new file mode 100644 index 00000000000..2581ca3fe84 --- /dev/null +++ b/jdk-headers/.idea/ant.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/jdk-headers/.idea/artifacts/jdk_headers_jar.xml b/jdk-headers/.idea/artifacts/jdk_headers_jar.xml new file mode 100644 index 00000000000..f2e8de23b4d --- /dev/null +++ b/jdk-headers/.idea/artifacts/jdk_headers_jar.xml @@ -0,0 +1,13 @@ + + + $PROJECT_DIR$ + + + + + + + + + + \ No newline at end of file diff --git a/jdk-headers/.idea/compiler.xml b/jdk-headers/.idea/compiler.xml new file mode 100644 index 00000000000..a1b41c52c72 --- /dev/null +++ b/jdk-headers/.idea/compiler.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/jdk-headers/.idea/copyright/profiles_settings.xml b/jdk-headers/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000000..3572571ad83 --- /dev/null +++ b/jdk-headers/.idea/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jdk-headers/.idea/encodings.xml b/jdk-headers/.idea/encodings.xml new file mode 100644 index 00000000000..e206d70d859 --- /dev/null +++ b/jdk-headers/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/jdk-headers/.idea/misc.xml b/jdk-headers/.idea/misc.xml new file mode 100644 index 00000000000..97320410eec --- /dev/null +++ b/jdk-headers/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/jdk-headers/.idea/modules.xml b/jdk-headers/.idea/modules.xml new file mode 100644 index 00000000000..4bfabd95716 --- /dev/null +++ b/jdk-headers/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/jdk-headers/.idea/scopes/scope_settings.xml b/jdk-headers/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000000..922003b8433 --- /dev/null +++ b/jdk-headers/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/jdk-headers/.idea/uiDesigner.xml b/jdk-headers/.idea/uiDesigner.xml new file mode 100644 index 00000000000..3b000203088 --- /dev/null +++ b/jdk-headers/.idea/uiDesigner.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jdk-headers/.idea/vcs.xml b/jdk-headers/.idea/vcs.xml new file mode 100644 index 00000000000..def6a6a1845 --- /dev/null +++ b/jdk-headers/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/jdk-headers/jdk-headers.iml b/jdk-headers/jdk-headers.iml new file mode 100644 index 00000000000..d5c07432750 --- /dev/null +++ b/jdk-headers/jdk-headers.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/jdk-headers/src/META-INF/MANIFEST.MF b/jdk-headers/src/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..59499bce4a2 --- /dev/null +++ b/jdk-headers/src/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/jdk-headers/src/java/lang/Iterable.kt b/jdk-headers/src/java/lang/Iterable.kt new file mode 100644 index 00000000000..cd19f19e5d3 --- /dev/null +++ b/jdk-headers/src/java/lang/Iterable.kt @@ -0,0 +1,5 @@ +package java.lang + +public trait Iterable { + fun iterator() : java.util.Iterator +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/AbstractCollection.kt b/jdk-headers/src/java/util/AbstractCollection.kt new file mode 100644 index 00000000000..d95adaeaed9 --- /dev/null +++ b/jdk-headers/src/java/util/AbstractCollection.kt @@ -0,0 +1,17 @@ +package java.util +abstract public open class AbstractCollection protected () : java.util.Collection, java.lang.Object { + abstract override public fun iterator() : java.util.Iterator + abstract override public fun size() : Int + override public fun isEmpty() : Boolean {} + override public fun contains(o : Any?) : Boolean {} + override public fun toArray() : Array {} + override public fun toArray(a : Array) : Array {} + override public fun add(e : E) : Boolean {} + override public fun remove(o : Any?) : Boolean {} + override public fun containsAll(c : java.util.Collection<*>) : Boolean {} + override public fun addAll(c : java.util.Collection) : Boolean {} + override public fun removeAll(c : java.util.Collection<*>) : Boolean {} + override public fun retainAll(c : java.util.Collection<*>) : Boolean {} + override public fun clear() : Unit {} +//override public fun toString() : java.lang.String {} +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/AbstractList.kt b/jdk-headers/src/java/util/AbstractList.kt new file mode 100644 index 00000000000..4c94916b6d2 --- /dev/null +++ b/jdk-headers/src/java/util/AbstractList.kt @@ -0,0 +1,20 @@ +package java.util +abstract public open class AbstractList protected () : java.util.AbstractCollection(), java.util.List { + override public fun add(e : E) : Boolean {} + abstract override public fun get(index : Int) : E + override public fun set(index : Int, element : E) : E {} + override public fun add(index : Int, element : E) : Unit {} + override public fun remove(index : Int) : E {} + override public fun indexOf(o : Any?) : Int {} + override public fun lastIndexOf(o : Any?) : Int {} + override public fun clear() : Unit {} + override public fun addAll(index : Int, c : java.util.Collection) : Boolean {} + override public fun iterator() : java.util.Iterator {} + override public fun listIterator() : java.util.ListIterator {} + override public fun listIterator(index : Int) : java.util.ListIterator {} + override public fun subList(fromIndex : Int, toIndex : Int) : java.util.List {} +// override public fun equals(o : Any?) : Boolean +// override public fun hashCode() : Int + open protected fun removeRange(fromIndex : Int, toIndex : Int) : Unit {} + protected var modCount : Int = 0 +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/AbstractMap.kt b/jdk-headers/src/java/util/AbstractMap.kt new file mode 100644 index 00000000000..98e17b74b72 --- /dev/null +++ b/jdk-headers/src/java/util/AbstractMap.kt @@ -0,0 +1,21 @@ +package java.util + +import java.util.Map.Entry + +abstract public open class AbstractMap protected () : java.util.Map, java.lang.Object { + override public fun size() : Int {} + override public fun isEmpty() : Boolean {} + override public fun containsValue(value : Any?) : Boolean {} + override public fun containsKey(key : Any?) : Boolean {} + override public fun get(key : Any?) : V? {} + override public fun put(key : K, value : V) : V? {} + override public fun remove(key : Any?) : V? {} + override public fun putAll(m : java.util.Map) : Unit {} + override public fun clear() : Unit {} + override public fun keySet() : java.util.Set {} + override public fun values() : java.util.Collection {} + abstract override public fun entrySet() : java.util.Set> + //override public fun equals(o : Any?) : Boolean + //override public fun hashCode() : Int + //override public fun toString() : java.lang.String? +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/AbstractSequentialList.kt b/jdk-headers/src/java/util/AbstractSequentialList.kt new file mode 100644 index 00000000000..2318cc39c2e --- /dev/null +++ b/jdk-headers/src/java/util/AbstractSequentialList.kt @@ -0,0 +1,10 @@ +package java.util +abstract public open class AbstractSequentialList protected () : java.util.AbstractList(), java.lang.Object { + override public fun get(index : Int) : E {} + override public fun set(index : Int, element : E) : E {} + override public fun add(index : Int, element : E) : Unit {} + override public fun remove(index : Int) : E {} + override public fun addAll(index : Int, c : java.util.Collection) : Boolean {} + override public fun iterator() : java.util.Iterator {} + abstract override public fun listIterator(index : Int) : java.util.ListIterator {} +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/AbstractSet.kt b/jdk-headers/src/java/util/AbstractSet.kt new file mode 100644 index 00000000000..bf6e6b83259 --- /dev/null +++ b/jdk-headers/src/java/util/AbstractSet.kt @@ -0,0 +1,6 @@ +package java.util +abstract public open class AbstractSet protected () : java.util.AbstractCollection(), java.util.Set, java.lang.Object { +// override public fun equals(o : Any?) : Boolean +// override public fun hashCode() : Int + override public fun removeAll(c : java.util.Collection<*>) : Boolean {} +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/ArrayList.kt b/jdk-headers/src/java/util/ArrayList.kt new file mode 100644 index 00000000000..612896ed369 --- /dev/null +++ b/jdk-headers/src/java/util/ArrayList.kt @@ -0,0 +1,38 @@ +package java.util +public open class ArrayList(c : java.util.Collection) : java.util.AbstractList(), + java.util.List, + java.util.RandomAccess, + java.lang.Cloneable, + java.io.Serializable, + java.lang.Object { + public this() {} + public this(initialCapacity : Int) {} + open public fun trimToSize() : Unit {} + open public fun ensureCapacity(minCapacity : Int) : Unit {} + override public fun size() : Int {} + override public fun isEmpty() : Boolean {} + override public fun contains(o : Any?) : Boolean {} + override public fun indexOf(o : Any?) : Int {} + override public fun lastIndexOf(o : Any?) : Int {} + override public fun clone() : java.lang.Object {} + override public fun toArray() : Array {} + override public fun toArray(a : Array) : Array {} + override public fun get(index : Int) : E {} + override public fun set(index : Int, element : E) : E {} + override public fun add(e : E) : Boolean {} + override public fun add(index : Int, element : E) : Unit {} + override public fun remove(index : Int) : E {} + override public fun remove(o : Any?) : Boolean {} + override public fun clear() : Unit {} + override public fun addAll(c : java.util.Collection) : Boolean {} + override public fun addAll(index : Int, c : java.util.Collection) : Boolean {} + override protected fun removeRange(fromIndex : Int, toIndex : Int) : Unit {} +// class object { +// open public fun init() : ArrayList { +// return __ +// } +// open public fun init(c : java.util.Collection?) : ArrayList { +// return __ +// } +// } +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/Collection.kt b/jdk-headers/src/java/util/Collection.kt new file mode 100644 index 00000000000..c852e48f1fd --- /dev/null +++ b/jdk-headers/src/java/util/Collection.kt @@ -0,0 +1,20 @@ +package java.util +public trait Collection : java.lang.Iterable { + open fun size() : Int + open fun isEmpty() : Boolean + open fun contains(o : Any?) : Boolean + override fun iterator() : java.util.Iterator + open fun toArray() : Array + // a : Array to emulate Java's array covariance + open fun toArray(a : Array) : Array + open fun add(e : E) : Boolean + open fun remove(o : Any?) : Boolean + open fun containsAll(c : java.util.Collection<*>) : Boolean + open fun addAll(c : java.util.Collection) : Boolean + open fun removeAll(c : java.util.Collection<*>) : Boolean + open fun retainAll(c : java.util.Collection<*>) : Boolean + open fun clear() : Unit + +// override fun equals(o : Any?) : Boolean +// override fun hashCode() : Int +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/Deque.kt b/jdk-headers/src/java/util/Deque.kt new file mode 100644 index 00000000000..5282d85c672 --- /dev/null +++ b/jdk-headers/src/java/util/Deque.kt @@ -0,0 +1,30 @@ +package java.util +public trait Deque : java.util.Queue { + open fun addFirst(e : E) : Unit + open fun addLast(e : E) : Unit + open fun offerFirst(e : E) : Boolean + open fun offerLast(e : E) : Boolean + open fun removeFirst() : E + open fun removeLast() : E + open fun pollFirst() : E? + open fun pollLast() : E? + open fun getFirst() : E + open fun getLast() : E + open fun peekFirst() : E? + open fun peekLast() : E? + open fun removeFirstOccurrence(o : Any?) : Boolean + open fun removeLastOccurrence(o : Any?) : Boolean + override fun add(e : E) : Boolean + override fun offer(e : E) : Boolean + override fun remove() : E + override fun poll() : E? + override fun element() : E + override fun peek() : E? + open fun push(e : E) : Unit + open fun pop() : E + override fun remove(o : Any?) : Boolean + override fun contains(o : Any?) : Boolean + override public fun size() : Int + override fun iterator() : java.util.Iterator + open fun descendingIterator() : java.util.Iterator +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/Enumeration.kt b/jdk-headers/src/java/util/Enumeration.kt new file mode 100644 index 00000000000..127a4b69ca9 --- /dev/null +++ b/jdk-headers/src/java/util/Enumeration.kt @@ -0,0 +1,5 @@ +package java.util +public trait Enumeration { + open fun hasMoreElements() : Boolean + open fun nextElement() : E +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/HashMap.kt b/jdk-headers/src/java/util/HashMap.kt new file mode 100644 index 00000000000..97ee82d5368 --- /dev/null +++ b/jdk-headers/src/java/util/HashMap.kt @@ -0,0 +1,24 @@ +package java.util +import java.io.* +public open class HashMap(m : java.util.Map) : java.util.AbstractMap(), + java.util.Map, + java.lang.Cloneable, + java.io.Serializable, + java.lang.Object { + public this() {} + public this(initialCapacity : Int) {} + public this(initialCapacity : Int, loadFactor : Float) {} + override public fun size() : Int {} + override public fun isEmpty() : Boolean {} + override public fun get(key : Any?) : V? {} + override public fun containsKey(key : Any?) : Boolean {} + override public fun put(key : K, value : V) : V? {} + override public fun putAll(m : java.util.Map) : Unit {} + override public fun remove(key : Any?) : V? {} + override public fun clear() : Unit {} + override public fun containsValue(value : Any?) : Boolean {} + override public fun clone() : Any? {} + override public fun keySet() : java.util.Set {} + override public fun values() : java.util.Collection {} + override public fun entrySet() : java.util.Set> {} +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/HashSet.kt b/jdk-headers/src/java/util/HashSet.kt new file mode 100644 index 00000000000..0017654f512 --- /dev/null +++ b/jdk-headers/src/java/util/HashSet.kt @@ -0,0 +1,40 @@ +package java.util +public open class HashSet(c : java.util.Collection) : java.util.AbstractSet(), + java.util.Set, + java.lang.Cloneable, + java.io.Serializable, + java.lang.Object { + public this() {} + public this(initialCapacity : Int) {} + public this(initialCapacity : Int, loadFactor : Float) {} + override public fun iterator() : java.util.Iterator {} + override public fun size() : Int {} + override public fun isEmpty() : Boolean {} + override public fun contains(o : Any?) : Boolean {} + override public fun add(e : E) : Boolean {} + override public fun remove(o : Any?) : Boolean {} + override public fun clear() : Unit {} + override public fun clone() : Any? {} +//class object { +//open public fun init() : HashSet { +//val __ = HashSet(0, null, null) +//return __ +//} +//open public fun init(c : java.util.Collection?) : HashSet { +//val __ = HashSet(0, null, null) +//return __ +//} +//open public fun init(initialCapacity : Int, loadFactor : Float) : HashSet { +//val __ = HashSet(0, null, null) +//return __ +//} +//open public fun init(initialCapacity : Int) : HashSet { +//val __ = HashSet(0, null, null) +//return __ +//} +//open fun init(initialCapacity : Int, loadFactor : Float, dummy : Boolean) : HashSet { +//val __ = HashSet(0, null, null) +//return __ +//} +//} +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/Iterator.kt b/jdk-headers/src/java/util/Iterator.kt new file mode 100644 index 00000000000..935228ebd73 --- /dev/null +++ b/jdk-headers/src/java/util/Iterator.kt @@ -0,0 +1,7 @@ +package java.util + +public trait Iterator { + fun hasNext() : Boolean + fun next() : E + fun remove() : Unit +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/LinkedHashMap.kt b/jdk-headers/src/java/util/LinkedHashMap.kt new file mode 100644 index 00000000000..e81d937d453 --- /dev/null +++ b/jdk-headers/src/java/util/LinkedHashMap.kt @@ -0,0 +1,34 @@ +package java.util +import java.io.* +public open class LinkedHashMap(m : java.util.Map) : java.util.HashMap(), java.util.Map, java.lang.Object { + public this(initialCapacity : Int, loadFactor : Float) {} + public this(initialCapacity : Int) {} + public this() {} + + override public fun containsValue(value : Any?) : Boolean {} + override public fun get(key : Any?) : V? {} + override public fun clear() : Unit {} + open protected fun removeEldestEntry(eldest : java.util.Map.Entry) : Boolean {} + //class object { + //open public fun init(initialCapacity : Int, loadFactor : Float) : LinkedHashMap { + //val __ = LinkedHashMap(0, null, false) + //return __ + //} + //open public fun init(initialCapacity : Int) : LinkedHashMap { + //val __ = LinkedHashMap(0, null, false) + //return __ + //} + //open public fun init() : LinkedHashMap { + //val __ = LinkedHashMap(0, null, false) + //return __ + //} + //open public fun init(m : java.util.Map?) : LinkedHashMap { + //val __ = LinkedHashMap(0, null, false) + //return __ + //} + //open public fun init(initialCapacity : Int, loadFactor : Float, accessOrder : Boolean) : LinkedHashMap { + //val __ = LinkedHashMap(0, null, false) + //return __ + //} + //} +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/LinkedHashSet.kt b/jdk-headers/src/java/util/LinkedHashSet.kt new file mode 100644 index 00000000000..4f85a4bdb0f --- /dev/null +++ b/jdk-headers/src/java/util/LinkedHashSet.kt @@ -0,0 +1,10 @@ +package java.util +public open class LinkedHashSet(c : java.util.Collection) : java.util.HashSet(c), + java.util.Set, + java.lang.Cloneable, + java.io.Serializable, + java.lang.Object { + public this(initialCapacity : Int, loadFactor : Float) {} + public this(initialCapacity : Int) {} + public this() {} +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/LinkedList.kt b/jdk-headers/src/java/util/LinkedList.kt new file mode 100644 index 00000000000..a4a0c4f83da --- /dev/null +++ b/jdk-headers/src/java/util/LinkedList.kt @@ -0,0 +1,54 @@ +package java.util +public open class LinkedList(c : java.util.Collection) : java.util.AbstractSequentialList(), + java.util.List, + java.util.Deque, + java.lang.Cloneable, + java.io.Serializable, + java.lang.Object { + public this() {} + + override public fun getFirst() : E {} + override public fun getLast() : E {} + override public fun removeFirst() : E {} + override public fun removeLast() : E {} + override public fun addFirst(e : E) : Unit {} + override public fun addLast(e : E) : Unit {} + override public fun contains(o : Any?) : Boolean {} + override public fun size() : Int {} + override public fun add(e : E) : Boolean {} + override public fun remove(o : Any?) : Boolean {} + override public fun addAll(c : java.util.Collection) : Boolean {} + override public fun addAll(index : Int, c : java.util.Collection) : Boolean {} + override public fun clear() : Unit {} + override public fun get(index : Int) : E {} + override public fun set(index : Int, element : E) : E {} + override public fun add(index : Int, element : E) : Unit {} + override public fun remove(index : Int) : E {} + override public fun indexOf(o : Any?) : Int {} + override public fun lastIndexOf(o : Any?) : Int {} + override public fun peek() : E? {} + override public fun element() : E {} + override public fun poll() : E? {} + override public fun remove() : E {} + override public fun offer(e : E) : Boolean {} + override public fun offerFirst(e : E) : Boolean {} + override public fun offerLast(e : E) : Boolean {} + override public fun peekFirst() : E? {} + override public fun peekLast() : E? {} + override public fun pollFirst() : E? {} + override public fun pollLast() : E? {} + override public fun push(e : E) : Unit {} + override public fun pop() : E {} + override public fun removeFirstOccurrence(o : Any?) : Boolean {} + override public fun removeLastOccurrence(o : Any?) : Boolean {} + override public fun listIterator(index : Int) : java.util.ListIterator {} + override public fun descendingIterator() : java.util.Iterator {} + override public fun clone() : Any? {} + override public fun toArray() : Array {} + override public fun toArray(a : Array) : Array {} +//class object { +//open public fun init(c : java.util.Collection?) : LinkedList { +//return __ +//} +//} +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/List.kt b/jdk-headers/src/java/util/List.kt new file mode 100644 index 00000000000..741ea472522 --- /dev/null +++ b/jdk-headers/src/java/util/List.kt @@ -0,0 +1,29 @@ +package java.util +public trait List : java.util.Collection { + override fun size() : Int + override fun isEmpty() : Boolean + override fun contains(o : Any?) : Boolean + override fun iterator() : java.util.Iterator + override fun toArray() : Array + // Simulate Java's array covariance + override fun toArray(a : Array) : Array + override fun add(e : E) : Boolean + override fun remove(o : Any?) : Boolean + override fun containsAll(c : java.util.Collection<*>) : Boolean + override fun addAll(c : java.util.Collection) : Boolean + open fun addAll(index : Int, c : java.util.Collection) : Boolean + override fun removeAll(c : java.util.Collection<*>) : Boolean + override fun retainAll(c : java.util.Collection<*>) : Boolean + override fun clear() : Unit +// override fun equals(o : Any?) : Boolean +// override fun hashCode() : Int + open fun get(index : Int) : E + open fun set(index : Int, element : E) : E + open fun add(index : Int, element : E) : Unit + open fun remove(index : Int) : E + open fun indexOf(o : Any?) : Int + open fun lastIndexOf(o : Any?) : Int + open fun listIterator() : java.util.ListIterator + open fun listIterator(index : Int) : java.util.ListIterator + open fun subList(fromIndex : Int, toIndex : Int) : java.util.List +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/Map.kt b/jdk-headers/src/java/util/Map.kt new file mode 100644 index 00000000000..fc28c9fe226 --- /dev/null +++ b/jdk-headers/src/java/util/Map.kt @@ -0,0 +1,28 @@ +package java.util + +public trait Map { + open fun size() : Int + open fun isEmpty() : Boolean + open fun containsKey(key : Any?) : Boolean + open fun containsValue(value : Any?) : Boolean + open fun get(key : Any?) : V? + open fun put(key : K, value : V) : V? + open fun remove(key : Any?) : V? + open fun putAll(m : java.util.Map) : Unit + open fun clear() : Unit + open fun keySet() : java.util.Set + open fun values() : java.util.Collection + open fun entrySet() : java.util.Set> +// open fun equals(o : Any?) : Boolean +// open fun hashCode() : Int + + class object { + trait Entry { + open fun getKey() : K + open fun getValue() : V + open fun setValue(value : V) : V +// open fun equals(o : Any?) : Boolean +// open fun hashCode() : Int + } + } +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/Queue.kt b/jdk-headers/src/java/util/Queue.kt new file mode 100644 index 00000000000..0a4eb0ecbfb --- /dev/null +++ b/jdk-headers/src/java/util/Queue.kt @@ -0,0 +1,9 @@ +package java.util +public trait Queue : java.util.Collection { + override fun add(e : E) : Boolean + open fun offer(e : E) : Boolean + open fun remove() : E + open fun poll() : E? + open fun element() : E + open fun peek() : E? +} \ No newline at end of file diff --git a/jdk-headers/src/java/util/Set.kt b/jdk-headers/src/java/util/Set.kt new file mode 100644 index 00000000000..7f07f5da03f --- /dev/null +++ b/jdk-headers/src/java/util/Set.kt @@ -0,0 +1,20 @@ +package java.util +public trait Set : java.util.Collection { + override fun size() : Int + override fun isEmpty() : Boolean + override fun contains(o : Any?) : Boolean + override fun iterator() : java.util.Iterator + override fun toArray() : Array + + // Simulate Java's array covariance + override fun toArray(a : Array) : Array + override fun add(e : E) : Boolean + override fun remove(o : Any?) : Boolean + override fun containsAll(c : java.util.Collection<*>) : Boolean + override fun addAll(c : java.util.Collection) : Boolean + override fun retainAll(c : java.util.Collection<*>) : Boolean + override fun removeAll(c : java.util.Collection<*>) : Boolean + override fun clear() : Unit +// override fun equals(o : Any?) : Boolean +// override fun hashCode() : Int +} \ No newline at end of file diff --git a/jdk-headers/test/test.iml b/jdk-headers/test/test.iml new file mode 100644 index 00000000000..b13953ece7d --- /dev/null +++ b/jdk-headers/test/test.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + From d00173dc69f5abc5773a530d660fc2ba4e639aa6 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 25 Jan 2012 17:33:06 +0400 Subject: [PATCH 06/11] Object removed from supertypes --- jdk-headers/src/java/util/ArrayList.kt | 3 +-- jdk-headers/src/java/util/Set.kt | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jdk-headers/src/java/util/ArrayList.kt b/jdk-headers/src/java/util/ArrayList.kt index 612896ed369..5c4c1e8ddb4 100644 --- a/jdk-headers/src/java/util/ArrayList.kt +++ b/jdk-headers/src/java/util/ArrayList.kt @@ -3,8 +3,7 @@ public open class ArrayList(c : java.util.Collection) : java.ut java.util.List, java.util.RandomAccess, java.lang.Cloneable, - java.io.Serializable, - java.lang.Object { + java.io.Serializable { public this() {} public this(initialCapacity : Int) {} open public fun trimToSize() : Unit {} diff --git a/jdk-headers/src/java/util/Set.kt b/jdk-headers/src/java/util/Set.kt index 7f07f5da03f..f1c70a6436d 100644 --- a/jdk-headers/src/java/util/Set.kt +++ b/jdk-headers/src/java/util/Set.kt @@ -17,4 +17,5 @@ public trait Set : java.util.Collection { override fun clear() : Unit // override fun equals(o : Any?) : Boolean // override fun hashCode() : Int -} \ No newline at end of file +} + From a5bd1c069f5a3d36b4bf7810e1d977eb2602a187 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 25 Jan 2012 18:50:14 +0400 Subject: [PATCH 07/11] KT-913 Weird errors attempting to declare ArrayList of function type KT-507 Wrong parsing of generic constructor calls with qualified names and functions --- .../lang/parsing/JetExpressionParsing.java | 2 +- .../FunctionTypesAsArguments.jet | 5 + .../FunctionTypesAsArguments.txt | 88 ++ .../greatSyntacticShift/functionLiterals.txt | 952 ++++++++++++ .../psi/greatSyntacticShift/functionTypes.txt | 1270 +++++++++++++++++ .../jetbrains/jet/parsing/JetParsingTest.java | 1 + 6 files changed, 2317 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.jet create mode 100644 compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.txt create mode 100644 compiler/testData/psi/greatSyntacticShift/functionLiterals.txt create mode 100644 compiler/testData/psi/greatSyntacticShift/functionTypes.txt 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 1e67a337309..7c2d367f74e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java @@ -39,7 +39,7 @@ public class JetExpressionParsing extends AbstractJetParsing { CONTINUE_KEYWORD, OBJECT_KEYWORD, IF_KEYWORD, TRY_KEYWORD, ELSE_KEYWORD, WHILE_KEYWORD, DO_KEYWORD, WHEN_KEYWORD, RBRACKET, RBRACE, RPAR, PLUSPLUS, MINUSMINUS, MUL, PLUS, MINUS, EXCL, DIV, PERC, LTEQ, // TODO GTEQ, foo=x - EQEQEQ, ARROW, ARROW, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR, SAFE_ACCESS, ELVIS, + EQEQEQ, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR, SAFE_ACCESS, ELVIS, SEMICOLON, RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ, NOT_IN, NOT_IS, //HASH, COLON ); diff --git a/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.jet b/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.jet new file mode 100644 index 00000000000..7611cfa0fcb --- /dev/null +++ b/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.jet @@ -0,0 +1,5 @@ +val commands = java.util.HashMap Unit>() // multiple errors + +class Lifetime{ + val attached = ArrayList<()->Unit>() +} diff --git a/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.txt b/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.txt new file mode 100644 index 00000000000..62c804fc629 --- /dev/null +++ b/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.txt @@ -0,0 +1,88 @@ +JetFile: FunctionTypesAsArguments.jet + NAMESPACE_HEADER + + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('commands') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('java') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('util') + PsiElement(DOT)('.') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('HashMap') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') + PsiElement(GT)('>') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiComment(EOL_COMMENT)('// multiple errors') + PsiWhiteSpace('\n\n') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Lifetime') + TYPE_PARAMETER_LIST + + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('attached') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('ArrayList') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(ARROW)('->') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') + PsiElement(GT)('>') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt new file mode 100644 index 00000000000..8d98dcae65a --- /dev/null +++ b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt @@ -0,0 +1,952 @@ +JetFile: functionLiterals.jet + NAMESPACE_HEADER + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Foo') + PsiWhiteSpace('\n') + TYPE_PARAMETER_LIST + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Bar') + PsiWhiteSpace('\n\n') + TYPE_PARAMETER_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(vararg)('vararg') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('test') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + DOT_QUALIFIED_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + PsiElement(LPAR)('(') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + PsiElement(LPAR)('(') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + PsiElement(LPAR)('(') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(QUEST)('?') + PsiWhiteSpace(' ') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + SELF_TYPE + PsiElement(This)('This') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + TUPLE_TYPE + PsiElement(HASH)('#') + PsiElement(LPAR)('(') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + DOT_QUALIFIED_EXPRESSION + TUPLE + PsiElement(HASH)('#') + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + TUPLE + PsiElement(HASH)('#') + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + DOT_QUALIFIED_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiElement(GT)('>') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + DOT_QUALIFIED_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiElement(GT)('>') + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiElement(GT)('>') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Baz') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiElement(GT)('>') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Baz') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/greatSyntacticShift/functionTypes.txt b/compiler/testData/psi/greatSyntacticShift/functionTypes.txt new file mode 100644 index 00000000000..fd200c73574 --- /dev/null +++ b/compiler/testData/psi/greatSyntacticShift/functionTypes.txt @@ -0,0 +1,1270 @@ +JetFile: functionTypes.jet + NAMESPACE_HEADER + + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + PsiErrorElement:Expecting namespace or top level declaration + PsiElement(package)('package') + PsiWhiteSpace(' ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting namespace or top level declaration + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace('\n') + TYPE_PARAMETER_LIST + + PsiErrorElement:Expecting namespace or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + CLASS + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('XXX') + TYPE_PARAMETER_LIST + + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a1') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('namespace') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a2') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a3') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiElement(LPAR)('(') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a31') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiElement(LPAR)('(') + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a4') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(QUEST)('?') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a5') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + PsiElement(LPAR)('(') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiElement(QUEST)('?') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a6') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiElement(LPAR)('(') + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(QUEST)('?') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a7') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a8') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace('\n\n') + PsiComment(EOL_COMMENT)('//val a9 : (A, B)') + PsiWhiteSpace('\n') + PsiComment(EOL_COMMENT)('//val a10 : (B)? -> B') + PsiWhiteSpace('\n\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a11') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + PsiElement(LPAR)('(') + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(QUEST)('?') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a12') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + PsiElement(LPAR)('(') + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiElement(LPAR)('(') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(RPAR)(')') + PsiElement(QUEST)('?') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a13') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a14') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a15') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(QUEST)('?') + PsiWhiteSpace(' ') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a152') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + PsiElement(LPAR)('(') + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(QUEST)('?') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a151') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiErrorElement:Property getter or setter expected + PsiElement(SAFE_ACCESS)('?.') + PsiElement(LPAR)('(') + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a16') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a17') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + PsiElement(LPAR)('(') + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a18') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiElement(LPAR)('(') + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a19') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + CLASS + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('YYY') + TYPE_PARAMETER_LIST + + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a7') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a8') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiWhiteSpace('\n') + PsiComment(EOL_COMMENT)('//val a9 : (A, B)') + PsiWhiteSpace('\n') + PsiComment(EOL_COMMENT)('//val a10 : (B)? -> B') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a11') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + PsiElement(LPAR)('(') + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(QUEST)('?') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a12') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + PsiElement(LPAR)('(') + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiElement(LPAR)('(') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(RPAR)(')') + PsiElement(QUEST)('?') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + NULL + PsiElement(null)('null') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a13') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a14') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('n') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a15') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(QUEST)('?') + PsiWhiteSpace(' ') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a152') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + PsiElement(LPAR)('(') + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(QUEST)('?') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a151') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiErrorElement:Property getter or setter expected + PsiElement(SAFE_ACCESS)('?.') + PsiElement(LPAR)('(') + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a16') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a17') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + TYPE_REFERENCE + PsiElement(LPAR)('(') + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a18') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiElement(LPAR)('(') + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n ') + PROPERTY + MODIFIER_LIST + PsiElement(abstract)('abstract') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a19') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/parsing/JetParsingTest.java b/compiler/tests/org/jetbrains/jet/parsing/JetParsingTest.java index 0191484e111..48433f12b24 100644 --- a/compiler/tests/org/jetbrains/jet/parsing/JetParsingTest.java +++ b/compiler/tests/org/jetbrains/jet/parsing/JetParsingTest.java @@ -111,6 +111,7 @@ public class JetParsingTest extends ParsingTestCase { String prefix = JetParsingTest.getTestDataDir() + "/psi/"; suite.addTest(JetTestCaseBuilder.suiteForDirectory(prefix, "/", false, factory)); suite.addTest(JetTestCaseBuilder.suiteForDirectory(prefix, "examples", true, factory)); + suite.addTest(JetTestCaseBuilder.suiteForDirectory(prefix, "greatSyntacticShift", true, factory)); return suite; } From f8123e5fb3bc23c0ad359826c64e4f86ac04cf18 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 25 Jan 2012 19:35:42 +0400 Subject: [PATCH 08/11] Basic support for Java and Kotlin annotations --- .../IDEA__No_ProcessCanceledException_.xml | 2 + .../resolve/java/JavaDescriptorResolver.java | 57 ++----------------- .../tests/annotations/BasicAnnotations.kt | 10 ++++ .../tests/annotations/Deprecated.jet | 7 +++ 4 files changed, 25 insertions(+), 51 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/annotations/BasicAnnotations.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/Deprecated.jet diff --git a/.idea/runConfigurations/IDEA__No_ProcessCanceledException_.xml b/.idea/runConfigurations/IDEA__No_ProcessCanceledException_.xml index 58141b697da..63d5ea84434 100644 --- a/.idea/runConfigurations/IDEA__No_ProcessCanceledException_.xml +++ b/.idea/runConfigurations/IDEA__No_ProcessCanceledException_.xml @@ -16,7 +16,9 @@