diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 7d92d477332..1397a2192d0 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -15,7 +15,6 @@
-
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 13927ade54d..463eb8bb67f 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -11,7 +11,6 @@
-
diff --git a/build.xml b/build.xml
index 8150c68078f..8f7b193af88 100644
--- a/build.xml
+++ b/build.xml
@@ -3,13 +3,9 @@
-
+
-
-
-
-
@@ -43,23 +39,14 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
@@ -70,7 +57,6 @@
-
@@ -84,32 +70,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassFileFactory.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassFileFactory.java
index 46e5b9e5472..475919c64c2 100644
--- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassFileFactory.java
+++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassFileFactory.java
@@ -1,6 +1,6 @@
package org.jetbrains.jet.codegen;
-import org.jetbrains.jet.lang.psi.JetNamespace;
+import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.psi.JetPsiUtil;
import java.util.*;
@@ -30,13 +30,13 @@ public class ClassFileFactory {
return newVisitor(className + ".class");
}
- NamespaceCodegen forNamespace(JetNamespace namespace) {
+ NamespaceCodegen forNamespace(JetFile file) {
assert !isDone : "Already done!";
- String fqName = JetPsiUtil.getFQName(namespace);
+ String fqName = JetPsiUtil.getFQName(file);
NamespaceCodegen codegen = ns2codegen.get(fqName);
if (codegen == null) {
final ClassBuilder builder = newVisitor(NamespaceCodegen.getJVMClassName(fqName) + ".class");
- codegen = new NamespaceCodegen(builder, fqName, state, namespace.getContainingFile());
+ codegen = new NamespaceCodegen(builder, fqName, state, file.getContainingFile());
ns2codegen.put(fqName, codegen);
}
diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java b/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java
index 461c528475d..a378304ac3d 100644
--- a/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java
+++ b/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java
@@ -6,6 +6,7 @@ package org.jetbrains.jet.codegen;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
+import com.intellij.psi.PsiElement;
import com.intellij.util.containers.Stack;
import org.jetbrains.jet.codegen.intrinsics.IntrinsicMethods;
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
@@ -78,15 +79,14 @@ public class GenerationState {
return Pair.create(className, factory.forAnonymousSubclass(className));
}
- public NamespaceCodegen forNamespace(JetNamespace namespace) {
+ public NamespaceCodegen forNamespace(JetFile namespace) {
return factory.forNamespace(namespace);
}
- public BindingContext compile(JetFile psiFile) {
- final JetNamespace namespace = psiFile.getRootNamespace();
- final BindingContext bindingContext = AnalyzerFacade.analyzeOneNamespaceWithJavaIntegration(namespace, JetControlFlowDataTraceFactory.EMPTY);
+ public BindingContext compile(JetFile file) {
+ final BindingContext bindingContext = AnalyzerFacade.analyzeOneFileWithJavaIntegration(file, JetControlFlowDataTraceFactory.EMPTY);
AnalyzingUtils.throwExceptionOnErrors(bindingContext);
- compileCorrectNamespaces(bindingContext, Collections.singletonList(namespace));
+ compileCorrectFiles(bindingContext, Collections.singletonList(file));
return bindingContext;
// NamespaceCodegen codegen = forNamespace(namespace);
// bindingContexts.push(bindingContext);
@@ -102,15 +102,15 @@ public class GenerationState {
// }
}
- public void compileCorrectNamespaces(BindingContext bindingContext, List namespaces) {
- compileCorrectNamespaces(bindingContext, namespaces, CompilationErrorHandler.THROW_EXCEPTION);
+ public void compileCorrectFiles(BindingContext bindingContext, List files) {
+ compileCorrectFiles(bindingContext, files, CompilationErrorHandler.THROW_EXCEPTION);
}
- public void compileCorrectNamespaces(BindingContext bindingContext, List namespaces, CompilationErrorHandler errorHandler) {
+ public void compileCorrectFiles(BindingContext bindingContext, List files, CompilationErrorHandler errorHandler) {
typeMapper = new JetTypeMapper(standardLibrary, bindingContext);
bindingContexts.push(bindingContext);
try {
- for (JetNamespace namespace : namespaces) {
+ for (JetFile namespace : files) {
try {
generateNamespace(namespace);
}
@@ -129,7 +129,7 @@ public class GenerationState {
}
}
- protected void generateNamespace(JetNamespace namespace) {
+ protected void generateNamespace(JetFile namespace) {
NamespaceCodegen codegen = forNamespace(namespace);
codegen.generate(namespace);
}
@@ -149,8 +149,8 @@ public class GenerationState {
return new GeneratedAnonymousClassDescriptor(nameAndVisitor.first, callableMethod.getSignature().getAsmMethod(), objectContext.outerWasUsed, null);
}
- public static void prepareAnonymousClasses(JetElement aClass, final JetTypeMapper typeMapper) {
- aClass.acceptChildren(new JetVisitorVoid() {
+ public static void prepareAnonymousClasses(PsiElement element, final JetTypeMapper typeMapper) {
+ element.acceptChildren(new JetVisitorVoid() {
@Override
public void visitJetElement(JetElement element) {
super.visitJetElement(element);
diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java
index a6ffef67541..288a75f7482 100644
--- a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java
+++ b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java
@@ -619,6 +619,11 @@ public class JetTypeMapper {
signatureVisitor.writeInterfaceBoundEnd();
}
}
+ if (jetType.getConstructor().getDeclarationDescriptor() instanceof TypeParameterDescriptor) {
+ signatureVisitor.writeInterfaceBound();
+ mapType(jetType, signatureVisitor);
+ signatureVisitor.writeInterfaceBoundEnd();
+ }
}
signatureVisitor.writeFormalTypeParameterEnd();
@@ -753,11 +758,12 @@ public class JetTypeMapper {
return name;
}
- @SuppressWarnings("unchecked") JetNamedDeclaration container = PsiTreeUtil.getParentOfType(expression, JetNamespace.class, JetClass.class, JetObjectDeclaration.class);
+ @SuppressWarnings("unchecked")
+ PsiElement container = PsiTreeUtil.getParentOfType(expression, JetFile.class, JetClass.class, JetObjectDeclaration.class);
String baseName;
- if (container instanceof JetNamespace) {
- baseName = NamespaceCodegen.getJVMClassName(JetPsiUtil.getFQName(((JetNamespace) container)));
+ if (container instanceof JetFile) {
+ baseName = NamespaceCodegen.getJVMClassName(JetPsiUtil.getFQName(((JetFile) container)));
}
else {
ClassDescriptor aClass = bindingContext.get(BindingContext.CLASS, container);
diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java
index c083b4a639d..6a07373bef3 100644
--- a/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java
+++ b/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java
@@ -43,8 +43,8 @@ public class NamespaceCodegen {
v.visitSource(sourceFile.getName(), null);
}
- public void generate(JetNamespace namespace) {
- NamespaceDescriptor descriptor = state.getBindingContext().get(BindingContext.NAMESPACE, namespace);
+ public void generate(JetFile file) {
+ NamespaceDescriptor descriptor = state.getBindingContext().get(BindingContext.NAMESPACE, file);
final CodegenContext context = CodegenContext.STATIC.intoNamespace(descriptor);
final FunctionCodegen functionCodegen = new FunctionCodegen(context, v, state);
@@ -52,10 +52,10 @@ public class NamespaceCodegen {
final ClassCodegen classCodegen = state.forClass();
if (v.generateCode()) {
- GenerationState.prepareAnonymousClasses(namespace, state.getTypeMapper());
+ GenerationState.prepareAnonymousClasses(file, state.getTypeMapper());
}
- for (JetDeclaration declaration : namespace.getDeclarations()) {
+ for (JetDeclaration declaration : file.getDeclarations()) {
if (declaration instanceof JetProperty) {
propertyCodegen.gen((JetProperty) declaration);
}
@@ -72,20 +72,20 @@ public class NamespaceCodegen {
else if (declaration instanceof JetClassOrObject) {
classCodegen.generate(context, (JetClassOrObject) declaration);
}
- else if (declaration instanceof JetNamespace) {
- JetNamespace childNamespace = (JetNamespace) declaration;
- state.forNamespace(childNamespace).generate(childNamespace);
- }
+// else if (declaration instanceof JetFile) {
+// JetFile childNamespace = (JetFile) declaration;
+// state.forNamespace(childNamespace).generate(childNamespace);
+// }
}
- if (hasNonConstantPropertyInitializers(namespace)) {
- generateStaticInitializers(namespace);
+ if (hasNonConstantPropertyInitializers(file)) {
+ generateStaticInitializers(file);
}
- generateTypeInfoFields(namespace, context);
+ generateTypeInfoFields(file, context);
}
- private void generateStaticInitializers(JetNamespace namespace) {
+ private void generateStaticInitializers(JetFile namespace) {
MethodVisitor mv = v.newMethod(namespace, ACC_PUBLIC | ACC_STATIC,
"", "()V", null, null);
if (v.generateCode()) {
@@ -115,9 +115,9 @@ public class NamespaceCodegen {
}
}
- private void generateTypeInfoFields(JetNamespace namespace, CodegenContext context) {
+ private void generateTypeInfoFields(JetFile file, CodegenContext context) {
if(context.typeInfoConstants != null) {
- String jvmClassName = getJVMClassName(namespace.getName());
+ String jvmClassName = getJVMClassName(file.getNamespaceHeader().getName());
for(int index = 0; index != context.typeInfoConstantsCount; index++) {
JetType type = context.reverseTypeInfoConstants.get(index);
String fieldName = "$typeInfoCache$" + index;
@@ -137,7 +137,7 @@ public class NamespaceCodegen {
v.visitFieldInsn(PUTSTATIC, jvmClassName, fieldName, "Ljet/TypeInfo;");
v.visitLabel(end);
v.visitInsn(ARETURN);
- FunctionCodegen.endVisit(v, "type info method", namespace);
+ FunctionCodegen.endVisit(v, "type info method", file);
}
}
}
@@ -187,7 +187,7 @@ public class NamespaceCodegen {
}
}
- private static boolean hasNonConstantPropertyInitializers(JetNamespace namespace) {
+ private static boolean hasNonConstantPropertyInitializers(JetFile namespace) {
for (JetDeclaration declaration : namespace.getDeclarations()) {
if (declaration instanceof JetProperty) {
final JetExpression initializer = ((JetProperty) declaration).getInitializer();
diff --git a/compiler/backend/src/org/jetbrains/jet/compiler/AbstractCompileEnvironment.java b/compiler/backend/src/org/jetbrains/jet/compiler/CompileEnvironment.java
similarity index 86%
rename from compiler/backend/src/org/jetbrains/jet/compiler/AbstractCompileEnvironment.java
rename to compiler/backend/src/org/jetbrains/jet/compiler/CompileEnvironment.java
index e18cfa82dca..40496b41a40 100644
--- a/compiler/backend/src/org/jetbrains/jet/compiler/AbstractCompileEnvironment.java
+++ b/compiler/backend/src/org/jetbrains/jet/compiler/CompileEnvironment.java
@@ -1,19 +1,20 @@
package org.jetbrains.jet.compiler;
+import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.PathManager;
-import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vfs.VirtualFileSystem;
import com.intellij.util.Function;
import com.intellij.util.Processor;
import jet.ExtensionFunction0;
import jet.modules.IModuleBuilder;
import jet.modules.IModuleSetBuilder;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.jet.JetCoreEnvironment;
import org.jetbrains.jet.codegen.ClassFileFactory;
import org.jetbrains.jet.codegen.GeneratedClassLoader;
-import org.jetbrains.jet.lang.psi.JetNamespace;
+import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.psi.JetPsiUtil;
import org.jetbrains.jet.plugin.JetMainDetector;
@@ -26,13 +27,74 @@ import java.util.List;
import java.util.jar.*;
/**
- * @author alex.tkachman
+ * The environment for compiling a bunch of source files or
+ *
+ * @author yole
*/
-public abstract class AbstractCompileEnvironment {
- protected Project project;
+public class CompileEnvironment {
+ private JetCoreEnvironment myEnvironment;
+ private final Disposable myRootDisposable;
+ private PrintStream myErrorStream = System.out;
- protected abstract void addToClasspath(File file);
+ public CompileEnvironment() {
+ myRootDisposable = new Disposable() {
+ @Override
+ public void dispose() {
+ }
+ };
+ myEnvironment = new JetCoreEnvironment(myRootDisposable);
+ }
+ public void setErrorStream(PrintStream errorStream) {
+ myErrorStream = errorStream;
+ }
+
+ public void dispose() {
+ Disposer.dispose(myRootDisposable);
+ }
+
+ public boolean initializeKotlinRuntime() {
+ return initializeKotlinRuntime(myEnvironment);
+ }
+
+ public static boolean initializeKotlinRuntime(JetCoreEnvironment environment) {
+ final File unpackedRuntimePath = getUnpackedRuntimePath();
+ if (unpackedRuntimePath != null) {
+ environment.addToClasspath(unpackedRuntimePath);
+ }
+ else {
+ final File runtimeJarPath = getRuntimeJarPath();
+ if (runtimeJarPath != null && runtimeJarPath.exists()) {
+ environment.addToClasspath(runtimeJarPath);
+ }
+ else {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static File getUnpackedRuntimePath() {
+ URL url = CompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class");
+ if (url != null && url.getProtocol().equals("file")) {
+ return new File(url.getPath()).getParentFile().getParentFile();
+ }
+ return null;
+ }
+
+ public static File getRuntimeJarPath() {
+ URL url = CompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class");
+ if (url != null && url.getProtocol().equals("jar")) {
+ String path = url.getPath();
+ return new File(path.substring(path.indexOf(":") + 1, path.indexOf("!/")));
+ }
+ return null;
+ }
+
+ public void setJavaRuntime(File rtJarPath) {
+ myEnvironment.addToClasspath(rtJarPath);
+ }
+
public static File findRtJar(boolean failOnError) {
String javaHome = System.getenv("JAVA_HOME");
File rtJar;
@@ -99,52 +161,6 @@ public abstract class AbstractCompileEnvironment {
return null;
}
- public abstract VirtualFileSystem getLocalFileSystem();
-
- public abstract VirtualFileSystem getJarFileSystem();
-
- public Project getProject() {
- return project;
- }
-
- public static File getUnpackedRuntimePath() {
- URL url = CoreCompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class");
- if (url != null && url.getProtocol().equals("file")) {
- return new File(url.getPath()).getParentFile().getParentFile();
- }
- return null;
- }
-
- public static File getRuntimeJarPath() {
- URL url = CoreCompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class");
- if (url != null && url.getProtocol().equals("jar")) {
- String path = url.getPath();
- return new File(path.substring(path.indexOf(":") + 1, path.indexOf("!/")));
- }
- return null;
- }
-
- public static boolean initializeKotlinRuntime(AbstractCompileEnvironment environment) {
- final File unpackedRuntimePath = getUnpackedRuntimePath();
- if (unpackedRuntimePath != null) {
- environment.addToClasspath(unpackedRuntimePath);
- }
- else {
- final File runtimeJarPath = getRuntimeJarPath();
- if (runtimeJarPath != null && runtimeJarPath.exists()) {
- environment.addToClasspath(runtimeJarPath);
- }
- else {
- return false;
- }
- }
- return true;
- }
-
- public void setJavaRuntime(File rtJarPath) {
- addToClasspath(rtJarPath);
- }
-
public void compileModuleScript(String moduleFile, String jarPath, boolean jarRuntime) {
final IModuleSetBuilder moduleSetBuilder = loadModuleScript(moduleFile);
if (moduleSetBuilder == null) {
@@ -164,11 +180,11 @@ public abstract class AbstractCompileEnvironment {
}
public IModuleSetBuilder loadModuleScript(String moduleFile) {
- CompileSession scriptCompileSession = new CompileSession(this);
+ CompileSession scriptCompileSession = new CompileSession(myEnvironment);
scriptCompileSession.addSources(moduleFile);
scriptCompileSession.addStdLibSources();
- if (!scriptCompileSession.analyze(System.out)) {
+ if (!scriptCompileSession.analyze(myErrorStream)) {
return null;
}
final ClassFileFactory factory = scriptCompileSession.generate();
@@ -204,22 +220,22 @@ public abstract class AbstractCompileEnvironment {
}
public ClassFileFactory compileModule(IModuleBuilder moduleBuilder, String directory) {
- CompileSession moduleCompileSession = new CompileSession(this);
+ CompileSession moduleCompileSession = new CompileSession(myEnvironment);
moduleCompileSession.addStdLibSources();
for (String sourceFile : moduleBuilder.getSourceFiles()) {
moduleCompileSession.addSources(new File(directory, sourceFile).getPath());
}
for (String classpathRoot : moduleBuilder.getClasspathRoots()) {
- addToClasspath(new File(classpathRoot));
+ myEnvironment.addToClasspath(new File(classpathRoot));
}
- if (!moduleCompileSession.analyze(System.out)) {
+ if (!moduleCompileSession.analyze(myErrorStream)) {
return null;
}
return moduleCompileSession.generate();
}
private static String getHomeDirectory() {
- return new File(PathManager.getResourceRoot(CoreCompileEnvironment.class, "/org/jetbrains/jet/compiler/CoreCompileEnvironment.class")).getParentFile().getParentFile().getParent();
+ return new File(PathManager.getResourceRoot(CompileEnvironment.class, "/org/jetbrains/jet/compiler/CompileEnvironment.class")).getParentFile().getParentFile().getParent();
}
private static final List sanitized = Arrays.asList("kotlin/", "std/");
@@ -312,20 +328,19 @@ public abstract class AbstractCompileEnvironment {
}
}
- public void compileBunchOfSources(String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime, boolean stdlib) {
- CompileSession session = new CompileSession(this);
+ public void compileBunchOfSources(String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime) {
+ CompileSession session = new CompileSession(myEnvironment);
session.addSources(sourceFileOrDir);
- if(!stdlib)
- session.addStdLibSources();
+ session.addStdLibSources();
String mainClass = null;
- for (JetNamespace namespace : session.getSourceFileNamespaces()) {
- if (JetMainDetector.hasMain(namespace.getDeclarations())) {
- mainClass = JetPsiUtil.getFQName(namespace) + ".namespace";
+ for (JetFile file : session.getSourceFileNamespaces()) {
+ if (JetMainDetector.hasMain(file.getDeclarations())) {
+ mainClass = JetPsiUtil.getFQName(file) + ".namespace";
break;
}
}
- if (!session.analyze(System.out)) {
+ if (!session.analyze(myErrorStream)) {
return;
}
@@ -358,8 +373,4 @@ public abstract class AbstractCompileEnvironment {
// }
}
}
-
- public boolean initializeKotlinRuntime() {
- return initializeKotlinRuntime(this);
- }
}
diff --git a/compiler/backend/src/org/jetbrains/jet/compiler/CompileSession.java b/compiler/backend/src/org/jetbrains/jet/compiler/CompileSession.java
index 6945c0a8570..dffab3f4c06 100644
--- a/compiler/backend/src/org/jetbrains/jet/compiler/CompileSession.java
+++ b/compiler/backend/src/org/jetbrains/jet/compiler/CompileSession.java
@@ -4,14 +4,12 @@ import com.google.common.base.Predicates;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
+import org.jetbrains.jet.JetCoreEnvironment;
import org.jetbrains.jet.codegen.ClassBuilderFactory;
import org.jetbrains.jet.codegen.ClassFileFactory;
-import org.jetbrains.jet.codegen.CompilationErrorHandler;
import org.jetbrains.jet.codegen.GenerationState;
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
-import org.jetbrains.jet.lang.psi.JetDeclaration;
import org.jetbrains.jet.lang.psi.JetFile;
-import org.jetbrains.jet.lang.psi.JetNamespace;
import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacade;
import org.jetbrains.jet.plugin.JetFileType;
@@ -19,7 +17,6 @@ import org.jetbrains.jet.plugin.JetFileType;
import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
/**
@@ -28,13 +25,13 @@ import java.util.List;
* @author yole
*/
public class CompileSession {
- private final List mySourceFileNamespaces = new ArrayList();
- private final List myLibrarySourceFileNamespaces = new ArrayList();
+ private final JetCoreEnvironment myEnvironment;
+ private final List mySourceFiles = new ArrayList();
+ private final List myLibrarySourceFiles = new ArrayList();
private List myErrors = new ArrayList();
private BindingContext myBindingContext;
- private AbstractCompileEnvironment myEnvironment;
- public CompileSession(AbstractCompileEnvironment environment) {
+ public CompileSession(JetCoreEnvironment environment) {
myEnvironment = environment;
}
@@ -52,64 +49,42 @@ public class CompileSession {
return;
}
- addSources(new File(path), mySourceFileNamespaces);
+ addSources(new File(path));
}
- private void addSources(File file, List namespaces) {
+ private void addSources(File file) {
if(file.isDirectory()) {
for (File child : file.listFiles()) {
- addSources(child, namespaces);
+ addSources(child);
}
}
else {
VirtualFile fileByPath = myEnvironment.getLocalFileSystem().findFileByPath(file.getAbsolutePath());
PsiFile psiFile = PsiManager.getInstance(myEnvironment.getProject()).findFile(fileByPath);
if(psiFile instanceof JetFile) {
- namespaces.add(((JetFile) psiFile).getRootNamespace());
+ mySourceFiles.add((JetFile) psiFile);
}
}
}
public void addSources(VirtualFile vFile) {
- addSources(vFile, mySourceFileNamespaces);
- }
-
- public void addSources(VirtualFile vFile, List namespaces) {
if (vFile.isDirectory()) {
for (VirtualFile virtualFile : vFile.getChildren()) {
- addSources(virtualFile, namespaces);
+ addSources(virtualFile);
}
}
else {
if (vFile.getFileType() == JetFileType.INSTANCE) {
PsiFile psiFile = PsiManager.getInstance(myEnvironment.getProject()).findFile(vFile);
if (psiFile instanceof JetFile) {
- mySourceFileNamespaces.add(((JetFile) psiFile).getRootNamespace());
+ mySourceFiles.add((JetFile) psiFile);
}
}
}
}
- public void addSources(VirtualFile[] allFiles) {
- for(VirtualFile vFile: allFiles) {
- if (vFile.getFileType() == JetFileType.INSTANCE) {
- PsiFile psiFile = PsiManager.getInstance(myEnvironment.getProject()).findFile(vFile);
- if (psiFile instanceof JetFile) {
- mySourceFileNamespaces.add(((JetFile) psiFile).getRootNamespace());
- }
- }
- }
- }
-
- public List getSourceFileNamespaces() {
- return mySourceFileNamespaces;
- }
-
- public BindingContext analyze() {
- List allNamespaces = new ArrayList(mySourceFileNamespaces);
- allNamespaces.addAll(myLibrarySourceFileNamespaces);
- return AnalyzerFacade.analyzeNamespacesWithJavaIntegration(
- myEnvironment.getProject(), allNamespaces, Predicates.alwaysTrue(), JetControlFlowDataTraceFactory.EMPTY);
+ public List getSourceFileNamespaces() {
+ return mySourceFiles;
}
public boolean analyze(final PrintStream out) {
@@ -119,48 +94,38 @@ public class CompileSession {
}
return false;
}
- myBindingContext = analyze();
+ List allNamespaces = new ArrayList(mySourceFiles);
+ allNamespaces.addAll(myLibrarySourceFiles);
+ myBindingContext = AnalyzerFacade.analyzeFilesWithJavaIntegration(
+ myEnvironment.getProject(), allNamespaces, Predicates.alwaysTrue(), JetControlFlowDataTraceFactory.EMPTY);
ErrorCollector errorCollector = new ErrorCollector(myBindingContext);
errorCollector.report(out);
return !errorCollector.hasErrors;
}
public ClassFileFactory generate() {
- return generate(CompilationErrorHandler.THROW_EXCEPTION);
- }
-
- public ClassFileFactory generate(CompilationErrorHandler handler) {
GenerationState generationState = new GenerationState(myEnvironment.getProject(), ClassBuilderFactory.BINARIES);
- generationState.compileCorrectNamespaces(myBindingContext, mySourceFileNamespaces, handler);
+ generationState.compileCorrectFiles(myBindingContext, mySourceFiles);
return generationState.getFactory();
}
public String generateText() {
GenerationState generationState = new GenerationState(myEnvironment.getProject(), ClassBuilderFactory.TEXT);
- generationState.compileCorrectNamespaces(myBindingContext, mySourceFileNamespaces);
+ generationState.compileCorrectFiles(myBindingContext, mySourceFiles);
return generationState.createText();
}
public boolean addStdLibSources() {
- return addStdLibSources(false);
- }
-
- public boolean addStdLibSources(boolean forAnalize) {
- /*
- @todo
- We add sources as library sources in case of jar
- but as regular one if there is no jar
- */
- final File unpackedRuntimePath = CoreCompileEnvironment.getUnpackedRuntimePath();
+ final File unpackedRuntimePath = CompileEnvironment.getUnpackedRuntimePath();
if (unpackedRuntimePath != null) {
- addSources(new File(unpackedRuntimePath, "stdlib/ktSrc").getAbsoluteFile(), forAnalize ? myLibrarySourceFileNamespaces : mySourceFileNamespaces);
+ addSources(new File(unpackedRuntimePath, "../../../stdlib/ktSrc").getAbsoluteFile());
}
else {
- final File runtimeJarPath = CoreCompileEnvironment.getRuntimeJarPath();
+ final File runtimeJarPath = CompileEnvironment.getRuntimeJarPath();
if (runtimeJarPath != null && runtimeJarPath.exists()) {
VirtualFile runtimeJar = myEnvironment.getLocalFileSystem().findFileByPath(runtimeJarPath.getAbsolutePath());
VirtualFile jarRoot = myEnvironment.getJarFileSystem().findFileByPath(runtimeJar.getPath() + "!/stdlib/ktSrc");
- addSources(jarRoot, myLibrarySourceFileNamespaces);
+ addSources(jarRoot);
}
else {
return false;
@@ -168,8 +133,4 @@ public class CompileSession {
}
return true;
}
-
- public List getLibrarySourceFileNamespaces() {
- return myLibrarySourceFileNamespaces;
- }
}
diff --git a/compiler/backend/src/org/jetbrains/jet/compiler/CoreCompileEnvironment.java b/compiler/backend/src/org/jetbrains/jet/compiler/CoreCompileEnvironment.java
deleted file mode 100644
index d612ee0764a..00000000000
--- a/compiler/backend/src/org/jetbrains/jet/compiler/CoreCompileEnvironment.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.jetbrains.jet.compiler;
-
-import com.intellij.openapi.Disposable;
-import com.intellij.openapi.application.PathManager;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Disposer;
-import com.intellij.openapi.util.io.FileUtil;
-import com.intellij.openapi.vfs.VirtualFileSystem;
-import com.intellij.util.Processor;
-import jet.ExtensionFunction0;
-import jet.modules.IModuleBuilder;
-import jet.modules.IModuleSetBuilder;
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.jet.JetCoreEnvironment;
-import org.jetbrains.jet.codegen.ClassFileFactory;
-import org.jetbrains.jet.codegen.GeneratedClassLoader;
-import org.jetbrains.jet.lang.psi.JetNamespace;
-import org.jetbrains.jet.lang.psi.JetPsiUtil;
-import org.jetbrains.jet.plugin.JetMainDetector;
-
-import java.io.*;
-import java.lang.reflect.Field;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-import java.util.jar.*;
-
-/**
- * The environment for compiling a bunch of source files or
- *
- * @author yole
- * @author alex.tkachman
- */
-public class CoreCompileEnvironment extends AbstractCompileEnvironment {
- private final Disposable myRootDisposable;
- private final VirtualFileSystem localFileSystem;
- private VirtualFileSystem jarFileSystem;
- private JetCoreEnvironment myEnvironment;
-
- public CoreCompileEnvironment() {
- myRootDisposable = new Disposable() {
- @Override
- public void dispose() {
- }
- };
- myEnvironment = new JetCoreEnvironment(myRootDisposable);
- localFileSystem = myEnvironment.getLocalFileSystem();
- jarFileSystem = myEnvironment.getJarFileSystem();
- project = myEnvironment.getProject();
- }
-
- public CoreCompileEnvironment(JetCoreEnvironment myEnvironment) {
- this.myRootDisposable = null;
- this.myEnvironment = myEnvironment;
- localFileSystem = myEnvironment.getLocalFileSystem();
- jarFileSystem = myEnvironment.getJarFileSystem();
- project = myEnvironment.getProject();
- }
-
- public void dispose() {
- if(myRootDisposable != null)
- Disposer.dispose(myRootDisposable);
- }
-
- @Override
- public void addToClasspath(File file) {
- myEnvironment.addToClasspath(file);
- }
-
- @Override
- public VirtualFileSystem getLocalFileSystem() {
- return localFileSystem;
- }
-
- @Override
- public Project getProject() {
- return project;
- }
-
- @Override
- public VirtualFileSystem getJarFileSystem() {
- return jarFileSystem;
- }
-}
diff --git a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java
index 4b82fa150ce..56db85a522d 100644
--- a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java
+++ b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java
@@ -2,8 +2,7 @@ package org.jetbrains.jet.cli;
import com.sampullara.cli.Args;
import com.sampullara.cli.Argument;
-import org.jetbrains.jet.compiler.AbstractCompileEnvironment;
-import org.jetbrains.jet.compiler.CoreCompileEnvironment;
+import org.jetbrains.jet.compiler.CompileEnvironment;
import org.jetbrains.jet.compiler.CompileEnvironmentException;
/**
@@ -26,8 +25,6 @@ public class KotlinCompiler {
public String module;
@Argument(value = "includeRuntime", description = "include Kotlin runtime in to resulting jar")
public boolean includeRuntime;
- @Argument(value = "stdlib", description = "means that we compile stdlib itself")
- public boolean stdlib;
}
public static void main(String[] args) {
@@ -42,10 +39,10 @@ public class KotlinCompiler {
return;
}
- CoreCompileEnvironment environment = new CoreCompileEnvironment();
+ CompileEnvironment environment = new CompileEnvironment();
try {
- environment.setJavaRuntime(AbstractCompileEnvironment.findRtJar(true));
+ environment.setJavaRuntime(CompileEnvironment.findRtJar(true));
if (!environment.initializeKotlinRuntime()) {
System.out.println("No runtime library found");
return;
@@ -56,7 +53,7 @@ public class KotlinCompiler {
return;
}
else {
- environment.compileBunchOfSources(arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime, arguments.stdlib);
+ environment.compileBunchOfSources(arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime);
}
} catch (CompileEnvironmentException e) {
System.out.println(e.getMessage());
diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.java
index d5da9040092..d99e9a0b500 100644
--- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.java
+++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.java
@@ -17,45 +17,39 @@ import org.jetbrains.jet.lang.StandardConfiguration;
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils;
import org.jetbrains.jet.lang.diagnostics.Errors;
-import org.jetbrains.jet.lang.psi.JetDeclaration;
import org.jetbrains.jet.lang.psi.JetFile;
-import org.jetbrains.jet.lang.psi.JetNamespace;
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.BindingTraceContext;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.List;
/**
* @author abreslav
*/
public class AnalyzerFacade {
- public static final Function> SINGLE_DECLARATION_PROVIDER = new Function>() {
+ public static final Function> SINGLE_DECLARATION_PROVIDER = new Function>() {
@Override
- public Collection fun(JetFile file) {
- return Collections.singleton(file.getRootNamespace());
+ public Collection fun(JetFile file) {
+ return Collections.singleton(file);
}
};
private final static Key> BINDING_CONTEXT = Key.create("BINDING_CONTEXT");
private static final Object lock = new Object();
- public static BindingContext analyzeFileWithCache(@NotNull final JetFile file, @NotNull final Function> declarationProvider) {
-
+ public static BindingContext analyzeFileWithCache(@NotNull final JetFile file, @NotNull final Function> declarationProvider) {
// Need lock for getValue(), because parallel threads can start evaluation of compute() simultaneously
synchronized (lock) {
-
CachedValue bindingContextCachedValue = file.getUserData(BINDING_CONTEXT);
if (bindingContextCachedValue == null) {
bindingContextCachedValue = CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider() {
@Override
public Result compute() {
try {
- BindingContext bindingContext = analyzeNamespacesWithJavaIntegration(file.getProject(), declarationProvider.fun(file), Predicates.equalTo(file), JetControlFlowDataTraceFactory.EMPTY);
+ BindingContext bindingContext = analyzeFilesWithJavaIntegration(file.getProject(), declarationProvider.fun(file), Predicates.equalTo(file), JetControlFlowDataTraceFactory.EMPTY);
return new Result(bindingContext, PsiModificationTracker.MODIFICATION_COUNT);
}
catch (ProcessCanceledException e) {
@@ -73,46 +67,32 @@ public class AnalyzerFacade {
}, false);
file.putUserData(BINDING_CONTEXT, bindingContextCachedValue);
}
-
return bindingContextCachedValue.getValue();
}
}
- public static BindingContext analyzeOneNamespaceWithJavaIntegration(JetNamespace namespace, JetControlFlowDataTraceFactory flowDataTraceFactory) {
- return analyzeNamespacesWithJavaIntegration(namespace.getProject(), Collections.singleton(namespace), Predicates.alwaysTrue(), flowDataTraceFactory);
+ public static BindingContext analyzeOneFileWithJavaIntegration(JetFile file, JetControlFlowDataTraceFactory flowDataTraceFactory) {
+ return analyzeFilesWithJavaIntegration(file.getProject(), Collections.singleton(file), Predicates.alwaysTrue(), flowDataTraceFactory);
}
- public static BindingContext analyzeNamespacesWithJavaIntegration(Project project, Collection extends JetDeclaration> declarations, Predicate filesToAnalyzeCompletely, JetControlFlowDataTraceFactory flowDataTraceFactory) {
+ public static BindingContext analyzeFilesWithJavaIntegration(Project project, Collection files, Predicate filesToAnalyzeCompletely, JetControlFlowDataTraceFactory flowDataTraceFactory) {
BindingTraceContext bindingTraceContext = new BindingTraceContext();
JetSemanticServices semanticServices = JetSemanticServices.createSemanticServices(project);
- return AnalyzingUtils.analyzeNamespacesWithGivenTrace(
+ return AnalyzingUtils.analyzeFilesWithGivenTrace(
project,
JavaBridgeConfiguration.createJavaBridgeConfiguration(project, bindingTraceContext, StandardConfiguration.createStandardConfiguration(project)),
- declarations,
+ files,
filesToAnalyzeCompletely,
flowDataTraceFactory,
bindingTraceContext,
semanticServices);
}
- public static BindingContext shallowAnalyzeFiles(Collection files) {
+ public static BindingContext shallowAnalyzeFiles(Collection files) {
assert files.size() > 0;
Project project = files.iterator().next().getProject();
- Collection namespaces = collectRootNamespaces(files);
-
- return analyzeNamespacesWithJavaIntegration(project, namespaces, Predicates.alwaysFalse(), JetControlFlowDataTraceFactory.EMPTY);
+ return analyzeFilesWithJavaIntegration(project, files, Predicates.alwaysFalse(), JetControlFlowDataTraceFactory.EMPTY);
}
-
- public static List collectRootNamespaces(Collection files) {
- List namespaces = new ArrayList();
-
- for (PsiFile file : files) {
- if (file instanceof JetFile) {
- namespaces.add(((JetFile) file).getRootNamespace());
- }
- }
- return namespaces;
- }
-}
+}
\ No newline at end of file
diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java
index 46dd32c5894..66dfe604e63 100644
--- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java
+++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java
@@ -166,8 +166,17 @@ public class JavaDescriptorResolver {
);
classDescriptor.setName(name);
+ class OuterClassTypeVariableResolver implements TypeVariableResolver {
+
+ @NotNull
+ @Override
+ public TypeParameterDescriptor getTypeVariable(@NotNull String name) {
+ throw new IllegalStateException("not implemented"); // TODO
+ }
+ }
+
List supertypes = new ArrayList();
- List typeParameters = resolveClassTypeParameters(psiClass, classDescriptor);
+ List typeParameters = resolveClassTypeParameters(psiClass, classDescriptor, new OuterClassTypeVariableResolver());
classDescriptor.setTypeConstructor(new TypeConstructorImpl(
classDescriptor,
Collections.emptyList(), // TODO
@@ -225,7 +234,10 @@ public class JavaDescriptorResolver {
classDescriptor,
Collections.emptyList(), // TODO
false);
- ValueParameterDescriptors valueParameterDescriptors = resolveParameterDescriptors(constructorDescriptor, constructor.getParameterList().getParameters());
+ ValueParameterDescriptors valueParameterDescriptors = resolveParameterDescriptors(constructorDescriptor,
+ constructor.getParameterList().getParameters(),
+ new TypeParameterListTypeVariableResolver(typeParameters) // TODO: outer too
+ );
if (valueParameterDescriptors.receiverType != null) {
throw new IllegalStateException();
}
@@ -242,14 +254,14 @@ public class JavaDescriptorResolver {
return classDescriptor;
}
- private List resolveClassTypeParameters(PsiClass psiClass, JavaClassDescriptor classDescriptor) {
+ private List resolveClassTypeParameters(PsiClass psiClass, JavaClassDescriptor classDescriptor, TypeVariableResolver typeVariableResolver) {
for (PsiAnnotation annotation : psiClass.getModifierList().getAnnotations()) {
if (annotation.getQualifiedName().equals(JvmStdlibNames.JET_CLASS.getFqName())) {
PsiLiteralExpression attributeValue = (PsiLiteralExpression) annotation.findAttributeValue(JvmStdlibNames.JET_CLASS_SIGNATURE);
if (attributeValue != null) {
String typeParametersString = (String) attributeValue.getValue();
if (typeParametersString != null) {
- return resolveClassTypeParametersFromJetSignature(typeParametersString, psiClass, classDescriptor);
+ return resolveClassTypeParametersFromJetSignature(typeParametersString, psiClass, classDescriptor, typeVariableResolver);
}
}
}
@@ -290,14 +302,20 @@ public class JavaDescriptorResolver {
private final PsiTypeParameterListOwner psiOwner;
private final String name;
private final TypeInfoVariance variance;
+ private final TypeVariableResolver typeVariableResolver;
protected JetSignatureTypeParameterVisitor(DeclarationDescriptor containingDeclaration, PsiTypeParameterListOwner psiOwner,
- String name, TypeInfoVariance variance)
+ String name, TypeInfoVariance variance, TypeVariableResolver typeVariableResolver)
{
+ if (name.isEmpty()) {
+ throw new IllegalStateException();
+ }
+
this.containingDeclaration = containingDeclaration;
this.psiOwner = psiOwner;
this.name = name;
this.variance = variance;
+ this.typeVariableResolver = typeVariableResolver;
}
int index = 0;
@@ -307,7 +325,7 @@ public class JavaDescriptorResolver {
@Override
public JetSignatureVisitor visitClassBound() {
- return new JetTypeJetSignatureReader(JavaDescriptorResolver.this, semanticServices.getJetSemanticServices().getStandardLibrary()) {
+ return new JetTypeJetSignatureReader(JavaDescriptorResolver.this, semanticServices.getJetSemanticServices().getStandardLibrary(), typeVariableResolver) {
@Override
protected void done(@NotNull JetType jetType) {
if (isJavaLangObject(jetType)) {
@@ -320,7 +338,7 @@ public class JavaDescriptorResolver {
@Override
public JetSignatureVisitor visitInterfaceBound() {
- return new JetTypeJetSignatureReader(JavaDescriptorResolver.this, semanticServices.getJetSemanticServices().getStandardLibrary()) {
+ return new JetTypeJetSignatureReader(JavaDescriptorResolver.this, semanticServices.getJetSemanticServices().getStandardLibrary(), typeVariableResolver) {
@Override
protected void done(@NotNull JetType jetType) {
upperBounds.add(jetType);
@@ -348,12 +366,28 @@ public class JavaDescriptorResolver {
/**
* @see #resolveMethodTypeParametersFromJetSignature(String, FunctionDescriptor)
*/
- private List resolveClassTypeParametersFromJetSignature(String jetSignature, final PsiClass clazz, final JavaClassDescriptor classDescriptor) {
+ private List resolveClassTypeParametersFromJetSignature(String jetSignature, final PsiClass clazz,
+ final JavaClassDescriptor classDescriptor, final TypeVariableResolver outerClassTypeVariableResolver) {
final List r = new ArrayList();
+
+ class MyTypeVariableResolver implements TypeVariableResolver {
+
+ @NotNull
+ @Override
+ public TypeParameterDescriptor getTypeVariable(@NotNull String name) {
+ for (TypeParameterDescriptor typeParameter : r) {
+ if (typeParameter.getName().equals(name)) {
+ return typeParameter;
+ }
+ }
+ return outerClassTypeVariableResolver.getTypeVariable(name);
+ }
+ }
+
new JetSignatureReader(jetSignature).accept(new JetSignatureExceptionsAdapter() {
@Override
public JetSignatureVisitor visitFormalTypeParameter(final String name, final TypeInfoVariance variance) {
- return new JetSignatureTypeParameterVisitor(classDescriptor, clazz, name, variance) {
+ return new JetSignatureTypeParameterVisitor(classDescriptor, clazz, name, variance, new MyTypeVariableResolver()) {
@Override
protected void done(TypeParameterDescriptor typeParameterDescriptor) {
r.add(typeParameterDescriptor);
@@ -548,12 +582,13 @@ public class JavaDescriptorResolver {
}
}
- public ValueParameterDescriptors resolveParameterDescriptors(DeclarationDescriptor containingDeclaration, PsiParameter[] parameters) {
+ public ValueParameterDescriptors resolveParameterDescriptors(DeclarationDescriptor containingDeclaration,
+ PsiParameter[] parameters, TypeVariableResolver typeVariableResolver) {
List result = new ArrayList();
JetType receiverType = null;
for (int i = 0, parametersLength = parameters.length; i < parametersLength; i++) {
PsiParameter parameter = parameters[i];
- JvmMethodParameterMeaning meaning = resolveParameterDescriptor(containingDeclaration, i, parameter);
+ JvmMethodParameterMeaning meaning = resolveParameterDescriptor(containingDeclaration, i, parameter, typeVariableResolver);
if (meaning.kind == JvmMethodParameterKind.TYPE_INFO) {
// TODO
} else if (meaning.kind == JvmMethodParameterKind.REGULAR) {
@@ -601,7 +636,8 @@ public class JavaDescriptorResolver {
}
@NotNull
- private JvmMethodParameterMeaning resolveParameterDescriptor(DeclarationDescriptor containingDeclaration, int i, PsiParameter parameter) {
+ private JvmMethodParameterMeaning resolveParameterDescriptor(DeclarationDescriptor containingDeclaration, int i,
+ PsiParameter parameter, TypeVariableResolver typeVariableResolver) {
PsiType psiType = parameter.getType();
JetType varargElementType;
@@ -663,7 +699,7 @@ public class JavaDescriptorResolver {
JetType outType;
if (typeFromAnnotation != null && typeFromAnnotation.length() > 0) {
- outType = semanticServices.getTypeTransformer().transformToType(typeFromAnnotation);
+ outType = semanticServices.getTypeTransformer().transformToType(typeFromAnnotation, typeVariableResolver);
} else {
outType = semanticServices.getTypeTransformer().transformToType(psiType);
}
@@ -750,6 +786,26 @@ public class JavaDescriptorResolver {
return typeSubstitutor;
}
+ private static class TypeParameterListTypeVariableResolver implements TypeVariableResolver {
+
+ private final List typeParameters;
+
+ private TypeParameterListTypeVariableResolver(List typeParameters) {
+ this.typeParameters = typeParameters;
+ }
+
+ @NotNull
+ @Override
+ public TypeParameterDescriptor getTypeVariable(@NotNull String name) {
+ for (TypeParameterDescriptor typeParameter : typeParameters) {
+ if (typeParameter.getName().equals(name)) {
+ return typeParameter;
+ }
+ }
+ throw new IllegalStateException("unresolver variable: " + name); // TODO: report properly
+ }
+ }
+
@Nullable
public FunctionDescriptor resolveMethodToFunctionDescriptor(DeclarationDescriptor owner, PsiClass psiClass, TypeSubstitutor typeSubstitutorForGenericSuperclasses, PsiMethod method) {
PsiType returnType = method.getReturnType();
@@ -763,7 +819,17 @@ public class JavaDescriptorResolver {
}
return functionDescriptor;
}
- DeclarationDescriptor classDescriptor = method.hasModifierProperty(PsiModifier.STATIC) ? resolveNamespace(method.getContainingClass()) : resolveClass(method.getContainingClass());
+ DeclarationDescriptor classDescriptor;
+ final List classTypeParameters;
+ if (method.hasModifierProperty(PsiModifier.STATIC)) {
+ classDescriptor = resolveNamespace(method.getContainingClass());
+ classTypeParameters = Collections.emptyList();
+ }
+ else {
+ ClassDescriptor classClassDescriptor = resolveClass(method.getContainingClass());
+ classDescriptor = classClassDescriptor;
+ classTypeParameters = classClassDescriptor.getTypeConstructor().getParameters();
+ }
if (classDescriptor == null) {
return null;
}
@@ -774,14 +840,39 @@ public class JavaDescriptorResolver {
method.getName()
);
methodDescriptorCache.put(method, functionDescriptorImpl);
- List typeParameters = resolveMethodTypeParameters(method, functionDescriptorImpl);
- ValueParameterDescriptors valueParameterDescriptors = resolveParameterDescriptors(functionDescriptorImpl, parameters);
+
+ // TODO: add outer classes
+ TypeParameterListTypeVariableResolver typeVariableResolverForParameters = new TypeParameterListTypeVariableResolver(classTypeParameters);
+
+ final List methodTypeParameters = resolveMethodTypeParameters(method, functionDescriptorImpl, typeVariableResolverForParameters);
+
+ class MethodTypeVariableResolver implements TypeVariableResolver {
+
+ @NotNull
+ @Override
+ public TypeParameterDescriptor getTypeVariable(@NotNull String name) {
+ for (TypeParameterDescriptor typeParameter : methodTypeParameters) {
+ if (typeParameter.getName().equals(name)) {
+ return typeParameter;
+ }
+ }
+ for (TypeParameterDescriptor typeParameter : classTypeParameters) {
+ if (typeParameter.getName().equals(name)) {
+ return typeParameter;
+ }
+ }
+ throw new IllegalStateException("unresolver variable: " + name); // TODO: report properly
+ }
+ }
+
+
+ ValueParameterDescriptors valueParameterDescriptors = resolveParameterDescriptors(functionDescriptorImpl, parameters, new MethodTypeVariableResolver());
functionDescriptorImpl.initialize(
valueParameterDescriptors.receiverType,
DescriptorUtils.getExpectedThisObjectIfNeeded(classDescriptor),
- typeParameters,
+ methodTypeParameters,
valueParameterDescriptors.descriptors,
- makeReturnType(returnType, method),
+ makeReturnType(returnType, method, new MethodTypeVariableResolver()),
Modality.convertFromFlags(method.hasModifierProperty(PsiModifier.ABSTRACT), !method.hasModifierProperty(PsiModifier.FINAL)),
resolveVisibilityFromPsiModifiers(method)
);
@@ -793,14 +884,14 @@ public class JavaDescriptorResolver {
return substitutedFunctionDescriptor;
}
- private List resolveMethodTypeParameters(PsiMethod method, FunctionDescriptorImpl functionDescriptorImpl) {
+ private List resolveMethodTypeParameters(PsiMethod method, FunctionDescriptorImpl functionDescriptorImpl, TypeVariableResolver classTypeVariableResolver) {
for (PsiAnnotation annotation : method.getModifierList().getAnnotations()) {
if (annotation.getQualifiedName().equals(JvmStdlibNames.JET_METHOD.getFqName())) {
PsiLiteralExpression attributeValue = (PsiLiteralExpression) annotation.findAttributeValue(JvmStdlibNames.JET_METHOD_TYPE_PARAMETERS_FIELD);
if (attributeValue != null) {
String typeParametersString = (String) attributeValue.getValue();
if (typeParametersString != null) {
- List r = resolveMethodTypeParametersFromJetSignature(typeParametersString, method, functionDescriptorImpl);
+ List r = resolveMethodTypeParametersFromJetSignature(typeParametersString, method, functionDescriptorImpl, classTypeVariableResolver);
initializeTypeParameters(method);
return r;
}
@@ -816,13 +907,30 @@ public class JavaDescriptorResolver {
/**
* @see #resolveClassTypeParametersFromJetSignature(String, com.intellij.psi.PsiClass, JavaClassDescriptor)
*/
- private List resolveMethodTypeParametersFromJetSignature(String jetSignature, final PsiMethod method, final FunctionDescriptor functionDescriptor) {
+ private List resolveMethodTypeParametersFromJetSignature(String jetSignature, final PsiMethod method,
+ final FunctionDescriptor functionDescriptor, final TypeVariableResolver classTypeVariableResolver)
+ {
final List r = new ArrayList();
+
+ class MyTypeVariableResolver implements TypeVariableResolver {
+
+ @NotNull
+ @Override
+ public TypeParameterDescriptor getTypeVariable(@NotNull String name) {
+ for (TypeParameterDescriptor typeParameter : r) {
+ if (typeParameter.getName().equals(name)) {
+ return typeParameter;
+ }
+ }
+ return classTypeVariableResolver.getTypeVariable(name);
+ }
+ }
+
new JetSignatureReader(jetSignature).acceptFormalTypeParametersOnly(new JetSignatureExceptionsAdapter() {
@Override
public JetSignatureVisitor visitFormalTypeParameter(final String name, final TypeInfoVariance variance) {
- return new JetSignatureTypeParameterVisitor(functionDescriptor, method, name, variance) {
+ return new JetSignatureTypeParameterVisitor(functionDescriptor, method, name, variance, new MyTypeVariableResolver()) {
@Override
protected void done(TypeParameterDescriptor typeParameterDescriptor) {
r.add(typeParameterDescriptor);
@@ -834,7 +942,7 @@ public class JavaDescriptorResolver {
return r;
}
- private JetType makeReturnType(PsiType returnType, PsiMethod method) {
+ private JetType makeReturnType(PsiType returnType, PsiMethod method, TypeVariableResolver typeVariableResolver) {
boolean changeNullable = false;
boolean nullable = true;
@@ -859,7 +967,7 @@ public class JavaDescriptorResolver {
}
JetType transformedType;
if (returnTypeFromAnnotation != null && returnTypeFromAnnotation.length() > 0) {
- transformedType = semanticServices.getTypeTransformer().transformToType(returnTypeFromAnnotation);
+ transformedType = semanticServices.getTypeTransformer().transformToType(returnTypeFromAnnotation, typeVariableResolver);
} else {
transformedType = semanticServices.getTypeTransformer().transformToType(returnType);
}
diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.java
index fde7a02232c..40a6c60b35d 100644
--- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.java
+++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.java
@@ -59,9 +59,9 @@ public class JavaTypeTransformer {
}
@NotNull
- public JetType transformToType(@NotNull String kotlinSignature) {
+ public JetType transformToType(@NotNull String kotlinSignature, TypeVariableResolver typeVariableResolver) {
final JetType[] r = new JetType[1];
- JetTypeJetSignatureReader reader = new JetTypeJetSignatureReader(resolver, standardLibrary) {
+ JetTypeJetSignatureReader reader = new JetTypeJetSignatureReader(resolver, standardLibrary, typeVariableResolver) {
@Override
protected void done(@NotNull JetType jetType) {
r[0] = jetType;
diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader.java
index ec5b1b2a7ee..520da450766 100644
--- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader.java
+++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader.java
@@ -2,6 +2,7 @@ package org.jetbrains.jet.lang.resolve.java;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
+import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
import org.jetbrains.jet.lang.types.ErrorUtils;
import org.jetbrains.jet.lang.types.JetStandardClasses;
@@ -25,10 +26,12 @@ public abstract class JetTypeJetSignatureReader extends JetSignatureExceptionsAd
private final JavaDescriptorResolver javaDescriptorResolver;
private final JetStandardLibrary jetStandardLibrary;
+ private final TypeVariableResolver typeVariableResolver;
- public JetTypeJetSignatureReader(JavaDescriptorResolver javaDescriptorResolver, JetStandardLibrary jetStandardLibrary) {
+ public JetTypeJetSignatureReader(JavaDescriptorResolver javaDescriptorResolver, JetStandardLibrary jetStandardLibrary, TypeVariableResolver typeVariableResolver) {
this.javaDescriptorResolver = javaDescriptorResolver;
this.jetStandardLibrary = jetStandardLibrary;
+ this.typeVariableResolver = typeVariableResolver;
}
@@ -111,7 +114,7 @@ public abstract class JetTypeJetSignatureReader extends JetSignatureExceptionsAd
@Override
public JetSignatureVisitor visitTypeArgument(final char wildcard) {
- return new JetTypeJetSignatureReader(javaDescriptorResolver, jetStandardLibrary) {
+ return new JetTypeJetSignatureReader(javaDescriptorResolver, jetStandardLibrary, typeVariableResolver) {
@Override
protected void done(@NotNull JetType jetType) {
@@ -122,7 +125,7 @@ public abstract class JetTypeJetSignatureReader extends JetSignatureExceptionsAd
@Override
public JetSignatureVisitor visitArrayType(final boolean nullable) {
- return new JetTypeJetSignatureReader(javaDescriptorResolver, jetStandardLibrary) {
+ return new JetTypeJetSignatureReader(javaDescriptorResolver, jetStandardLibrary, typeVariableResolver) {
@Override
protected void done(@NotNull JetType jetType) {
JetType arrayType = TypeUtils.makeNullableAsSpecified(jetStandardLibrary.getArrayType(jetType), nullable);
@@ -133,8 +136,8 @@ public abstract class JetTypeJetSignatureReader extends JetSignatureExceptionsAd
@Override
public void visitTypeVariable(String name, boolean nullable) {
- // TODO: need a way to get type TypeParameterDescriptor by name
- throw new IllegalStateException();
+ JetType r = TypeUtils.makeNullableAsSpecified(typeVariableResolver.getTypeVariable(name).getDefaultType(), nullable);
+ done(r);
}
@Override
diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/TypeVariableResolver.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/TypeVariableResolver.java
new file mode 100644
index 00000000000..9f391218d72
--- /dev/null
+++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/TypeVariableResolver.java
@@ -0,0 +1,12 @@
+package org.jetbrains.jet.lang.resolve.java;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
+
+/**
+ * @author Stepan Koltsov
+ */
+public interface TypeVariableResolver {
+ @NotNull
+ TypeParameterDescriptor getTypeVariable(@NotNull String name);
+}
diff --git a/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java b/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java
index eebdbc8085e..67a4e2a3cf6 100644
--- a/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java
+++ b/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java
@@ -10,7 +10,6 @@ import org.jetbrains.jet.lang.psi.*;
public interface JetNodeTypes {
IFileElementType JET_FILE = new IFileElementType(JetLanguage.INSTANCE);
- JetNodeType NAMESPACE = new JetNodeType("NAMESPACE", JetNamespace.class);
JetNodeType CLASS = new JetNodeType("CLASS", JetClass.class);
JetNodeType PROPERTY = new JetNodeType("PROPERTY", JetProperty.class);
JetNodeType FUN = new JetNodeType("FUN", JetNamedFunction.class);
@@ -35,7 +34,6 @@ public interface JetNodeTypes {
JetNodeType CLASS_BODY = new JetNodeType("CLASS_BODY", JetClassBody.class);
JetNodeType IMPORT_DIRECTIVE = new JetNodeType("IMPORT_DIRECTIVE", JetImportDirective.class);
- JetNodeType NAMESPACE_BODY = new JetNodeType("NAMESPACE_BODY", JetNamespaceBody.class);
JetNodeType MODIFIER_LIST = new JetNodeType("MODIFIER_LIST", JetModifierList.class);
JetNodeType PRIMARY_CONSTRUCTOR_MODIFIER_LIST = new JetNodeType("PRIMARY_CONSTRUCTOR_MODIFIER_LIST", JetModifierList.class);
JetNodeType ANNOTATION = new JetNodeType("ANNOTATION", JetAnnotation.class);
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.java
index 648c8bfe5d2..814dc67acb8 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.java
@@ -7,8 +7,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
import org.jetbrains.jet.lang.resolve.BindingContext;
-import static org.jetbrains.jet.lang.diagnostics.Severity.ERROR;
-
/**
* @author abreslav
*/
@@ -37,7 +35,7 @@ public interface RedeclarationDiagnostic extends DiagnosticWithPsiElement getDeclarations() {
+ return PsiTreeUtil.getChildrenOfTypeAsList(this, JetDeclaration.class);
+ }
+
+ public List getImportDirectives() {
+ return PsiTreeUtil.getChildrenOfTypeAsList(this, JetImportDirective.class);
+ }
+
@NotNull
- public JetNamespace getRootNamespace() {
- return (JetNamespace) getNode().findChildByType(JetNodeTypes.NAMESPACE).getPsi();
+ public JetNamespaceHeader getNamespaceHeader() {
+ return (JetNamespaceHeader) getNode().findChildByType(JetNodeTypes.NAMESPACE_HEADER).getPsi();
+ }
+
+ @NotNull
+ @Override
+ public String getName() {
+ return super.getName(); // TODO
}
@Override
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespace.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespace.java
deleted file mode 100644
index aa82f6a2b35..00000000000
--- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespace.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.jetbrains.jet.lang.psi;
-
-import com.intellij.lang.ASTNode;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.util.PsiTreeUtil;
-import com.intellij.util.IncorrectOperationException;
-import org.jetbrains.annotations.NonNls;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.jet.JetNodeTypes;
-
-import java.util.List;
-
-/**
- * @author max
- */
-public class JetNamespace extends JetNamedDeclaration {
- public JetNamespace(@NotNull ASTNode node) {
- super(node);
- }
-
- @Override
- public void accept(@NotNull JetVisitorVoid visitor) {
- visitor.visitNamespace(this);
- }
-
- @Override
- public R accept(@NotNull JetVisitor visitor, D data) {
- return visitor.visitNamespace(this, data);
- }
-
- public List getDeclarations() {
- PsiElement body = findChildByType(JetNodeTypes.NAMESPACE_BODY);
- return PsiTreeUtil.getChildrenOfTypeAsList(body != null ? body : this, JetDeclaration.class);
- }
-
- public List getImportDirectives() {
- PsiElement body = findChildByType(JetNodeTypes.NAMESPACE_BODY);
- return PsiTreeUtil.getChildrenOfTypeAsList(body != null ? body : this, JetImportDirective.class);
- }
-
- public String getName() {
- String name = super.getName();
- return name == null ? "" : name;
- }
-
- @NotNull
- public JetNamespaceHeader getHeader() {
- return (JetNamespaceHeader) findChildByType(JetNodeTypes.NAMESPACE_HEADER);
- }
-
- @Override
- public PsiElement getNameIdentifier() {
- return getHeader().getNameIdentifier();
- }
-
- @Override
- public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNewExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNewExpression.java
deleted file mode 100644
index b7edbc97ee2..00000000000
--- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNewExpression.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.jetbrains.jet.lang.psi;
-
-/**
- * @author max
- */
-//public class JetNewExpression extends JetExpression implements JetCallElement {
-// public JetNewExpression(@NotNull ASTNode node) {
-// super(node);
-// }
-//
-// @Override
-// public void accept(JetVisitorVoid visitor) {
-// visitor.visitNewExpression(this);
-// }
-//
-// @Nullable @IfNotParsed
-// public JetTypeReference getTypeReference() {
-// return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
-// }
-//
-// @Override
-// @Nullable
-// public JetValueArgumentList getValueArgumentList() {
-// return (JetValueArgumentList) findChildByType(JetNodeTypes.VALUE_ARGUMENT_LIST);
-// }
-//
-// @Override
-// @NotNull
-// public List getValueArguments() {
-// JetValueArgumentList list = getValueArgumentList();
-// return list != null ? list.getArguments() : Collections.emptyList();
-// }
-//
-// @Override
-// @NotNull
-// public List getFunctionLiteralArguments() {
-// return findChildrenByType(JetNodeTypes.FUNCTION_LITERAL_EXPRESSION);
-// }
-//
-// @NotNull
-// @Override
-// public List getTypeArguments() {
-// return Collections.emptyList();
-// }
-//
-// @NotNull
-// @Override
-// public JetElement asElement() {
-// return this;
-// }
-//
-//}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiFactory.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiFactory.java
index e01dfdaeee4..d542ea6a699 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiFactory.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiFactory.java
@@ -60,8 +60,7 @@ public class JetPsiFactory {
private static T createDeclaration(Project project, String text, Class clazz) {
JetFile file = createFile(project, text);
- JetNamespace rootNamespace = file.getRootNamespace();
- List dcls = rootNamespace.getDeclarations();
+ List dcls = file.getDeclarations();
assert dcls.size() == 1 : dcls.size();
@SuppressWarnings("unchecked")
T result = (T) dcls.get(0);
@@ -92,13 +91,13 @@ public class JetPsiFactory {
return function.getValueParameters().get(0);
}
- public static JetNamespace createNamespace(Project project, String text) {
- JetFile file = createFile(project, text);
- return file.getRootNamespace();
- }
+// public static JetNamespace createNamespace(Project project, String text) {
+// JetFile file = createFile(project, text);
+// return file.getRootNamespace();
+// }
public static JetImportDirective createImportDirective(Project project, String classPath) {
- JetNamespace namespace = createNamespace(project, "import " + classPath);
+ JetFile namespace = createFile(project, "import " + classPath);
return namespace.getImportDirectives().iterator().next();
}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java
index 2c874a7a299..525be31df08 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java
@@ -1,7 +1,6 @@
package org.jetbrains.jet.lang.psi;
import com.intellij.psi.PsiElement;
-import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lexer.JetTokens;
@@ -72,7 +71,7 @@ public class JetPsiUtil {
public static JetNamedFunction getSurroundingFunction(@Nullable PsiElement element) {
while (element != null) {
if (element instanceof JetNamedFunction) return (JetNamedFunction) element;
- if (element instanceof JetClassOrObject || element instanceof JetNamespace) return null;
+ if (element instanceof JetClassOrObject || element instanceof JetFile) return null;
element = element.getParent();
}
return null;
@@ -104,16 +103,16 @@ public class JetPsiUtil {
}
}
- public static String getFQName(JetNamespace jetNamespace) {
- JetNamespace parent = PsiTreeUtil.getParentOfType(jetNamespace, JetNamespace.class);
- if (parent != null) {
- String parentFQName = getFQName(parent);
- if (parentFQName.length() > 0) {
- return parentFQName + "." + getFQName(jetNamespace.getHeader());
- }
- }
- return getFQName(jetNamespace.getHeader()); // TODO: Must include module root namespace
- }
+// public static String getFQName(JetNamespace jetNamespace) {
+// JetNamespace parent = PsiTreeUtil.getParentOfType(jetNamespace, JetNamespace.class);
+// if (parent != null) {
+// String parentFQName = getFQName(parent);
+// if (parentFQName.length() > 0) {
+// return parentFQName + "." + getFQName(jetNamespace.getNamespaceHeader());
+// }
+// }
+// return getFQName(jetNamespace.getNamespaceHeader()); // TODO: Must include module root namespace
+// }
private static String getFQName(JetNamespaceHeader header) {
StringBuilder builder = new StringBuilder();
@@ -121,15 +120,18 @@ public class JetPsiUtil {
builder.append(nameExpression.getReferencedName());
builder.append(".");
}
-// PsiElement nameIdentifier = header.getNameIdentifier();
builder.append(header.getName());
return builder.toString();
}
+ public static String getFQName(JetFile file) {
+ return getFQName(file.getNamespaceHeader());
+ }
+
public static String getFQName(JetClass jetClass) {
- JetNamedDeclaration parent = PsiTreeUtil.getParentOfType(jetClass, JetNamespace.class, JetClass.class);
- if (parent instanceof JetNamespace) {
- return makeFQName(getFQName(((JetNamespace) parent)), jetClass);
+ PsiElement parent = jetClass.getParent();
+ if (parent instanceof JetFile) {
+ return makeFQName(getFQName((JetFile) parent), jetClass);
}
if (parent instanceof JetClass) {
return makeFQName(getFQName(((JetClass) parent)), jetClass);
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java
index d75649d31e8..ac6575605e4 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java
@@ -15,10 +15,6 @@ public class JetVisitor extends PsiElementVisitor {
return visitExpression(dcl, data);
}
- public R visitNamespace(JetNamespace namespace, D data) {
- return visitDeclaration(namespace, data);
- }
-
public R visitClass(JetClass klass, D data) {
return visitNamedDeclaration(klass, data);
}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitorVoid.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitorVoid.java
index f3b7fde8385..ab9879b839a 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitorVoid.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitorVoid.java
@@ -14,10 +14,6 @@ public class JetVisitorVoid extends PsiElementVisitor {
visitExpression(dcl);
}
- public void visitNamespace(JetNamespace namespace) {
- visitDeclaration(namespace);
- }
-
public void visitClass(JetClass klass) {
visitNamedDeclaration(klass);
}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnalyzingUtils.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnalyzingUtils.java
index 5e0b2c9135c..57691b696fa 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnalyzingUtils.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnalyzingUtils.java
@@ -16,7 +16,7 @@ import org.jetbrains.jet.lang.descriptors.*;
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
import org.jetbrains.jet.lang.diagnostics.DiagnosticHolder;
import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils;
-import org.jetbrains.jet.lang.psi.JetDeclaration;
+import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
@@ -69,21 +69,21 @@ public class AnalyzingUtils {
// --------------------------------------------------------------------------------------------------------------------------
- public static BindingContext analyzeNamespaces(
+ public static BindingContext analyzeFiles(
@NotNull Project project,
@NotNull Configuration configuration,
- @NotNull Collection extends JetDeclaration> declarations,
+ @NotNull Collection files,
@NotNull Predicate filesToAnalyzeCompletely,
@NotNull JetControlFlowDataTraceFactory flowDataTraceFactory) {
BindingTraceContext bindingTraceContext = new BindingTraceContext();
JetSemanticServices semanticServices = JetSemanticServices.createSemanticServices(project);
- return analyzeNamespacesWithGivenTrace(project, configuration, declarations, filesToAnalyzeCompletely, flowDataTraceFactory, bindingTraceContext, semanticServices);
+ return analyzeFilesWithGivenTrace(project, configuration, files, filesToAnalyzeCompletely, flowDataTraceFactory, bindingTraceContext, semanticServices);
}
- public static BindingContext analyzeNamespacesWithGivenTrace(
+ public static BindingContext analyzeFilesWithGivenTrace(
@NotNull Project project,
@NotNull Configuration configuration,
- @NotNull Collection extends JetDeclaration> declarations,
+ @NotNull Collection files,
@NotNull Predicate filesToAnalyzeCompletely,
@NotNull JetControlFlowDataTraceFactory flowDataTraceFactory,
@NotNull BindingTraceContext bindingTraceContext,
@@ -130,7 +130,7 @@ public class AnalyzingUtils {
public ClassObjectStatus setClassObjectDescriptor(@NotNull MutableClassDescriptor classObjectDescriptor) {
throw new IllegalStateException("Must be guaranteed not to happen by the parser");
}
- }, declarations, filesToAnalyzeCompletely, flowDataTraceFactory, configuration);
+ }, files, filesToAnalyzeCompletely, flowDataTraceFactory, configuration);
return bindingTraceContext.getBindingContext();
}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java
index 0799347b34b..4cc757284ef 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java
@@ -8,7 +8,6 @@ import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.calls.ResolvedCall;
-import org.jetbrains.jet.lang.resolve.calls.ResolvedCallImpl;
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
import org.jetbrains.jet.lang.types.DeferredType;
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java
index d7d495ad416..47071e7a1d9 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java
@@ -63,8 +63,8 @@ public class DeclarationResolver {
}
private void resolveFunctionAndPropertyHeaders() {
- for (Map.Entry entry : context.getNamespaceScopes().entrySet()) {
- JetNamespace namespace = entry.getKey();
+ for (Map.Entry entry : context.getNamespaceScopes().entrySet()) {
+ JetFile namespace = entry.getKey();
WritableScope namespaceScope = entry.getValue();
NamespaceLike namespaceDescriptor = context.getNamespaceDescriptors().get(namespace);
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ImportsResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ImportsResolver.java
index b9b81c3c7c3..79c66054e37 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ImportsResolver.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ImportsResolver.java
@@ -39,15 +39,15 @@ public class ImportsResolver {
private void processImports(boolean firstPhase) {
ImportResolver importResolver = new ImportResolver(context.getTrace(), firstPhase);
- for (JetNamespace jetNamespace : context.getNamespaceDescriptors().keySet()) {
- WritableScope namespaceScope = context.getNamespaceScopes().get(jetNamespace);
+ for (JetFile file : context.getNamespaceDescriptors().keySet()) {
+ WritableScope namespaceScope = context.getNamespaceScopes().get(file);
if (firstPhase) {
context.getConfiguration().addDefaultImports(context.getTrace(), namespaceScope);
}
- List importDirectives = jetNamespace.getImportDirectives();
+ List importDirectives = file.getImportDirectives();
for (JetImportDirective importDirective : importDirectives) {
- importResolver.processImportReference(importDirective, namespaceScope, context.getDeclaringScopes().get(jetNamespace));
+ importResolver.processImportReference(importDirective, namespaceScope, JetScope.EMPTY);
}
}
}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.java
index 8b5148b0210..db01ad8461b 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.java
@@ -30,8 +30,8 @@ import java.util.Set;
private final ImportsResolver importsResolver;
private final Map classes = Maps.newLinkedHashMap();
private final Map objects = Maps.newLinkedHashMap();
- protected final Map namespaceScopes = Maps.newHashMap();
- protected final Map namespaceDescriptors = Maps.newHashMap();
+ protected final Map namespaceScopes = Maps.newHashMap();
+ protected final Map namespaceDescriptors = Maps.newHashMap();
private final Map declaringScopes = Maps.newHashMap();
private final Map functions = Maps.newLinkedHashMap();
@@ -114,11 +114,11 @@ import java.util.Set;
return objects;
}
- public Map getNamespaceScopes() {
+ public Map getNamespaceScopes() {
return namespaceScopes;
}
- public Map getNamespaceDescriptors() {
+ public Map getNamespaceDescriptors() {
return namespaceDescriptors;
}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.java
index a47e6a7e8ae..e6155266c1e 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.java
@@ -2,14 +2,14 @@ package org.jetbrains.jet.lang.resolve;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
+import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.Configuration;
import org.jetbrains.jet.lang.JetSemanticServices;
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
import org.jetbrains.jet.lang.descriptors.*;
-import org.jetbrains.jet.lang.psi.JetDeclaration;
-import org.jetbrains.jet.lang.psi.JetNamespace;
+import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.psi.JetObjectDeclaration;
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
@@ -29,12 +29,12 @@ public class TopDownAnalyzer {
@NotNull BindingTrace trace,
@NotNull JetScope outerScope,
@NotNull NamespaceLike owner,
- @NotNull Collection extends JetDeclaration> declarations,
+ @NotNull Collection files,
@NotNull Predicate analyzeCompletely,
@NotNull JetControlFlowDataTraceFactory flowDataTraceFactory,
@NotNull Configuration configuration
) {
- process(semanticServices, trace, outerScope, owner, declarations, analyzeCompletely, flowDataTraceFactory, configuration, false);
+ process(semanticServices, trace, outerScope, owner, files, analyzeCompletely, flowDataTraceFactory, configuration, false);
}
private static void process(
@@ -42,7 +42,7 @@ public class TopDownAnalyzer {
@NotNull BindingTrace trace,
@NotNull JetScope outerScope,
@NotNull NamespaceLike owner,
- @NotNull Collection extends JetDeclaration> declarations,
+ @NotNull Collection extends PsiElement> declarations,
@NotNull Predicate analyzeCompletely,
@NotNull JetControlFlowDataTraceFactory flowDataTraceFactory,
@NotNull Configuration configuration,
@@ -55,7 +55,7 @@ public class TopDownAnalyzer {
private static void doProcess(
TopDownAnalysisContext context, JetScope outerScope,
NamespaceLike owner,
- Collection extends JetDeclaration> declarations,
+ Collection extends PsiElement> declarations,
JetControlFlowDataTraceFactory flowDataTraceFactory) {
// context.enableDebugOutput();
context.debug("Enter");
@@ -93,14 +93,14 @@ public class TopDownAnalyzer {
@NotNull BindingTrace trace,
@NotNull WritableScope outerScope,
@NotNull NamespaceDescriptorImpl standardLibraryNamespace,
- @NotNull JetNamespace namespace) {
+ @NotNull JetFile file) {
TopDownAnalysisContext context = new TopDownAnalysisContext(semanticServices, trace, Predicates.alwaysTrue(), Configuration.EMPTY, false);
- context.getNamespaceScopes().put(namespace, standardLibraryNamespace.getMemberScope());
- context.getNamespaceDescriptors().put(namespace, standardLibraryNamespace);
- context.getDeclaringScopes().put(namespace, outerScope);
+ context.getNamespaceDescriptors().put(file, standardLibraryNamespace);
+ context.getNamespaceScopes().put(file, standardLibraryNamespace.getMemberScope());
+// context.getDeclaringScopes().put(file, outerScope);
context.setAnalyzingBootstrapLibrary(true);
- doProcess(context, outerScope, standardLibraryNamespace, namespace.getDeclarations(), JetControlFlowDataTraceFactory.EMPTY);
+ doProcess(context, outerScope, standardLibraryNamespace, file.getDeclarations(), JetControlFlowDataTraceFactory.EMPTY);
}
public static void processObject(
@@ -140,7 +140,7 @@ public class TopDownAnalyzer {
public ClassObjectStatus setClassObjectDescriptor(@NotNull MutableClassDescriptor classObjectDescriptor) {
return ClassObjectStatus.NOT_ALLOWED;
}
- }, Collections.singletonList(object), Predicates.equalTo(object.getContainingFile()), JetControlFlowDataTraceFactory.EMPTY, Configuration.EMPTY, true);
+ }, Collections.singletonList(object), Predicates.equalTo(object.getContainingFile()), JetControlFlowDataTraceFactory.EMPTY, Configuration.EMPTY, true);
}
}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.java
index 7a3efc82906..57082c51fc0 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.java
@@ -39,7 +39,7 @@ public class TypeHierarchyResolver {
this.context = context;
}
- public void process(@NotNull JetScope outerScope, @NotNull NamespaceLike owner, @NotNull Collection extends JetDeclaration> declarations) {
+ public void process(@NotNull JetScope outerScope, @NotNull NamespaceLike owner, @NotNull Collection extends PsiElement> declarations) {
collectNamespacesAndClassifiers(outerScope, outerScope, owner, declarations); // namespaceScopes, classes
context.getImportsResolver().processTypeImports();
@@ -67,22 +67,21 @@ public class TypeHierarchyResolver {
@NotNull final JetScope outerScope,
@NotNull final JetScope outerScopeForStatic,
@NotNull final NamespaceLike owner,
- @NotNull Collection extends JetDeclaration> declarations) {
- for (JetDeclaration declaration : declarations) {
+ @NotNull Collection extends PsiElement> declarations) {
+ for (PsiElement declaration : declarations) {
declaration.accept(new JetVisitorVoid() {
@Override
- public void visitNamespace(JetNamespace namespace) {
- NamespaceDescriptorImpl namespaceDescriptor = createNamespaceDescriptorPathIfNeeded(namespace, owner);
- context.getNamespaceDescriptors().put(namespace, namespaceDescriptor);
+ public void visitJetFile(JetFile file) {
+ NamespaceDescriptorImpl namespaceDescriptor = createNamespaceDescriptorPathIfNeeded(file, owner);
+ context.getNamespaceDescriptors().put(file, namespaceDescriptor);
WriteThroughScope namespaceScope = new WriteThroughScope(outerScope, namespaceDescriptor.getMemberScope(), new TraceBasedRedeclarationHandler(context.getTrace()));
namespaceScope.changeLockLevel(WritableScope.LockLevel.BOTH);
- context.getNamespaceScopes().put(namespace, namespaceScope);
- context.getDeclaringScopes().put(namespace, outerScope);
+ context.getNamespaceScopes().put(file, namespaceScope);
// processImports(namespace, namespaceScope, outerScope);
- collectNamespacesAndClassifiers(namespaceScope, namespaceScope, namespaceDescriptor, namespace.getDeclarations());
+ collectNamespacesAndClassifiers(namespaceScope, namespaceScope, namespaceDescriptor, file.getDeclarations());
}
@Override
@@ -195,19 +194,19 @@ public class TypeHierarchyResolver {
}
}
- private NamespaceDescriptorImpl createNamespaceDescriptorPathIfNeeded(JetNamespace namespace, NamespaceLike owner) {
+ private NamespaceDescriptorImpl createNamespaceDescriptorPathIfNeeded(JetFile file, NamespaceLike owner) {
NamespaceLike currentOwner = owner;
- for (JetSimpleNameExpression nameExpression : namespace.getHeader().getParentNamespaceNames()) {
+ for (JetSimpleNameExpression nameExpression : file.getNamespaceHeader().getParentNamespaceNames()) {
currentOwner = createNamespaceDescriptorIfNeeded(null, currentOwner, JetPsiUtil.safeName(nameExpression.getReferencedName()));
context.getTrace().record(REFERENCE_TARGET, nameExpression, currentOwner);
}
- String name = JetPsiUtil.safeName(namespace.getName());
- return createNamespaceDescriptorIfNeeded(namespace, currentOwner, name);
+ String name = JetPsiUtil.safeName(file.getNamespaceHeader().getName());
+ return createNamespaceDescriptorIfNeeded(file, currentOwner, name);
}
@NotNull
- private NamespaceDescriptorImpl createNamespaceDescriptorIfNeeded(@Nullable JetNamespace namespace, @NotNull NamespaceLike owner, @NotNull String name) {
+ private NamespaceDescriptorImpl createNamespaceDescriptorIfNeeded(@Nullable JetFile file, @NotNull NamespaceLike owner, @NotNull String name) {
NamespaceDescriptorImpl namespaceDescriptor = owner.getNamespace(name);
if (namespaceDescriptor == null) {
namespaceDescriptor = new NamespaceDescriptorImpl(
@@ -221,8 +220,8 @@ public class TypeHierarchyResolver {
namespaceDescriptor.initialize(scope);
context.getConfiguration().extendNamespaceScope(context.getTrace(), namespaceDescriptor, scope);
owner.addNamespace(namespaceDescriptor);
- if (namespace != null) {
- context.getTrace().record(BindingContext.NAMESPACE, namespace, namespaceDescriptor);
+ if (file != null) {
+ context.getTrace().record(BindingContext.NAMESPACE, file, namespaceDescriptor);
}
}
return namespaceDescriptor;
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/JetStandardLibrary.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/JetStandardLibrary.java
index 2edffdf51ea..1d73774dffa 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/types/JetStandardLibrary.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/JetStandardLibrary.java
@@ -137,7 +137,7 @@ public class JetStandardLibrary {
writableScope.changeLockLevel(WritableScope.LockLevel.BOTH);
// this.libraryScope = bootstrappingTDA.process(JetStandardClasses.STANDARD_CLASSES, file.getRootNamespace().getDeclarations());
// bootstrappingTDA.process(writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file.getRootNamespace().getDeclarations());
- TopDownAnalyzer.processStandardLibraryNamespace(bootstrappingSemanticServices, bindingTraceContext, writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file.getRootNamespace());
+ TopDownAnalyzer.processStandardLibraryNamespace(bootstrappingSemanticServices, bindingTraceContext, writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file);
// this.libraryScope = JetStandardClasses.STANDARD_CLASSES_NAMESPACE.getMemberScope();
AnalyzingUtils.throwExceptionOnErrors(bindingTraceContext.getBindingContext());
diff --git a/compiler/testData/compiler/smoke/src/Smoke.kt b/compiler/testData/compiler/smoke/Smoke.kt
similarity index 100%
rename from compiler/testData/compiler/smoke/src/Smoke.kt
rename to compiler/testData/compiler/smoke/Smoke.kt
diff --git a/compiler/testData/compiler/smoke/Smoke.kts b/compiler/testData/compiler/smoke/Smoke.kts
index 6bebb8d422c..d9429cd1b65 100644
--- a/compiler/testData/compiler/smoke/Smoke.kts
+++ b/compiler/testData/compiler/smoke/Smoke.kts
@@ -1,7 +1,6 @@
import kotlin.modules.*
val modules = module("smoke") {
- source files "src/Smoke.kt"
- testSource files "test/SmokeTest.kt"
+ source files "Smoke.kt"
jar name System.getProperty("java.io.tmpdir") + "/smoke.jar"
}
diff --git a/compiler/testData/compiler/smoke/test/SmokeTest.kt b/compiler/testData/compiler/smoke/test/SmokeTest.kt
deleted file mode 100644
index 8f5a1b26fef..00000000000
--- a/compiler/testData/compiler/smoke/test/SmokeTest.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-import std.io
-
-import junit.framework.*
-
-class SmokeTest() : TestCase() {
- fun testMe() {
- println("test")
- }
-}
diff --git a/compiler/testData/psi/AnnotatedExpressions.txt b/compiler/testData/psi/AnnotatedExpressions.txt
index e7be13766ce..3c6c46dd0a5 100644
--- a/compiler/testData/psi/AnnotatedExpressions.txt
+++ b/compiler/testData/psi/AnnotatedExpressions.txt
@@ -1,48 +1,47 @@
JetFile: AnnotatedExpressions.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- ANNOTATED_EXPRESSION
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
+ NAMESPACE_HEADER
+
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ ANNOTATED_EXPRESSION
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace('\n ')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ PsiWhiteSpace('\n ')
+ ANNOTATED_EXPRESSION
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ THIS_EXPRESSION
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace('\n ')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- PsiWhiteSpace('\n ')
- ANNOTATED_EXPRESSION
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- THIS_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(this)('this')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiElement(this)('this')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/AnonymousInitializer.txt b/compiler/testData/psi/AnonymousInitializer.txt
index cd55dd9b27c..76e9aeb1df4 100644
--- a/compiler/testData/psi/AnonymousInitializer.txt
+++ b/compiler/testData/psi/AnonymousInitializer.txt
@@ -1,49 +1,48 @@
JetFile: AnonymousInitializer.jet
- NAMESPACE
- NAMESPACE_HEADER
+ NAMESPACE_HEADER
+
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('Foo')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('Foo')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- ANONYMOUS_INITIALIZER
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- PROPERTY
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('c')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiWhiteSpace('\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ ANONYMOUS_INITIALIZER
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('c')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ PsiWhiteSpace('\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/Attributes.txt b/compiler/testData/psi/Attributes.txt
index 8119149e1b8..d1dfe903a18 100644
--- a/compiler/testData/psi/Attributes.txt
+++ b/compiler/testData/psi/Attributes.txt
@@ -1,48 +1,112 @@
JetFile: Attributes.jet
- NAMESPACE
- NAMESPACE_HEADER
- PsiElement(namespace)('package')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(DOT)('.')
- PsiElement(IDENTIFIER)('goo')
- PsiWhiteSpace('\n\n')
- CLASS
- MODIFIER_LIST
- PsiElement(abstract)('abstract')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(enum)('enum')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(annotation)('annotation')
- PsiWhiteSpace('\n')
- PsiElement(override)('override')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(abstract)('abstract')
- PsiWhiteSpace('\n')
- PsiElement(private)('private')
- PsiWhiteSpace('\n')
- PsiElement(protected)('protected')
- PsiWhiteSpace('\n')
- PsiElement(public)('public')
- PsiWhiteSpace('\n')
- PsiElement(internal)('internal')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
+ NAMESPACE_HEADER
+ PsiElement(namespace)('package')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(DOT)('.')
+ PsiElement(IDENTIFIER)('goo')
+ PsiWhiteSpace('\n\n')
+ CLASS
+ MODIFIER_LIST
+ PsiElement(abstract)('abstract')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(enum)('enum')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(annotation)('annotation')
+ PsiWhiteSpace('\n')
+ PsiElement(override)('override')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(abstract)('abstract')
+ PsiWhiteSpace('\n')
+ PsiElement(private)('private')
+ PsiWhiteSpace('\n')
+ PsiElement(protected)('protected')
+ PsiWhiteSpace('\n')
+ PsiElement(public)('public')
+ PsiWhiteSpace('\n')
+ PsiElement(internal)('internal')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('A')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('B')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('ina')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
USER_TYPE
+ USER_TYPE
+ USER_TYPE
+ USER_TYPE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('goo')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('doo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ PsiElement(GT)('>')
+ PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
TYPE_ARGUMENT_LIST
@@ -51,268 +115,203 @@ JetFile: Attributes.jet
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('A')
+ PsiElement(IDENTIFIER)('bar')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('B')
+ PsiElement(IDENTIFIER)('goo')
PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
+ PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('ina')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
+ PsiElement(IDENTIFIER)('df')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ PsiElement(in)('in')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('sdfsdf')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ PsiElement(out)('out')
+ PsiWhiteSpace('\n')
+ PsiElement(ref)('ref')
+ PsiWhiteSpace('\n ')
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('Bar')
+ TYPE_PARAMETER_LIST
+ PsiElement(LT)('<')
+ TYPE_PARAMETER
+ MODIFIER_LIST
+ PsiElement(abstract)('abstract')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('sdfsdf')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ BINARY_EXPRESSION
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('sdfsdf')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ BINARY_EXPRESSION
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ PsiElement(RPAR)(')')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('sdfsdf')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ BINARY_EXPRESSION
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ PsiElement(RPAR)(')')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ PsiElement(enum)('enum')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(annotation)('annotation')
+ PsiWhiteSpace('\n')
+ PsiElement(override)('override')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(abstract)('abstract')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('sdfsd')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('sdfsd')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
USER_TYPE
USER_TYPE
USER_TYPE
USER_TYPE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
+ PsiElement(IDENTIFIER)('a')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('goo')
+ PsiElement(IDENTIFIER)('b')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('doo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiElement(GT)('>')
+ PsiElement(IDENTIFIER)('f')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('goo')
- PsiElement(GT)('>')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('df')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- PsiElement(in)('in')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('sdfsdf')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- PsiElement(out)('out')
- PsiWhiteSpace('\n')
- PsiElement(ref)('ref')
- PsiWhiteSpace('\n ')
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('Bar')
- TYPE_PARAMETER_LIST
- PsiElement(LT)('<')
- TYPE_PARAMETER
- MODIFIER_LIST
- PsiElement(abstract)('abstract')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('sdfsdf')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- BINARY_EXPRESSION
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('sdfsdf')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- BINARY_EXPRESSION
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- PsiElement(RPAR)(')')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('sdfsdf')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- BINARY_EXPRESSION
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- PsiElement(RPAR)(')')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- PsiElement(enum)('enum')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(annotation)('annotation')
- PsiWhiteSpace('\n')
- PsiElement(override)('override')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(abstract)('abstract')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('sdfsd')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('sdfsd')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- USER_TYPE
- USER_TYPE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- PsiElement(private)('private')
- PsiWhiteSpace('\n')
- PsiElement(protected)('protected')
- PsiWhiteSpace('\n')
- PsiElement(public)('public')
- PsiWhiteSpace('\n')
- PsiElement(internal)('internal')
- PsiWhiteSpace('\n')
- PsiElement(in)('in')
- PsiWhiteSpace('\n')
- PsiElement(out)('out')
- PsiWhiteSpace('\n')
- PsiElement(ref)('ref')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiElement(IDENTIFIER)('c')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ PsiElement(private)('private')
+ PsiWhiteSpace('\n')
+ PsiElement(protected)('protected')
+ PsiWhiteSpace('\n')
+ PsiElement(public)('public')
+ PsiWhiteSpace('\n')
+ PsiElement(internal)('internal')
+ PsiWhiteSpace('\n')
+ PsiElement(in)('in')
+ PsiWhiteSpace('\n')
+ PsiElement(out)('out')
+ PsiWhiteSpace('\n')
+ PsiElement(ref)('ref')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/AttributesOnPatterns.txt b/compiler/testData/psi/AttributesOnPatterns.txt
index c2b2d07c73c..70fe4d48d45 100644
--- a/compiler/testData/psi/AttributesOnPatterns.txt
+++ b/compiler/testData/psi/AttributesOnPatterns.txt
@@ -1,185 +1,184 @@
JetFile: AttributesOnPatterns.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- VALUE_PARAMETER_LIST
+ NAMESPACE_HEADER
+
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ WHEN
+ PsiElement(when)('when')
+ PsiWhiteSpace(' ')
PsiElement(LPAR)('(')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('e')
PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
+ PsiWhiteSpace(' ')
PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- WHEN
- PsiElement(when)('when')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('e')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- PsiElement(is)('is')
- PsiWhiteSpace(' ')
- BINDING_PATTERN
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- PROPERTY
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ PsiElement(is)('is')
PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- PsiElement(is)('is')
- PsiWhiteSpace(' ')
- BINDING_PATTERN
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- PROPERTY
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- WHEN_CONDITION_IS_PATTERN
- PsiElement(is)('is')
- PsiWhiteSpace(' ')
- TYPE_PATTERN
+ BINDING_PATTERN
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- PsiElement(is)('is')
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
- WILDCARD_PATTERN
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
+ PROPERTY
+ PsiElement(val)('val')
PsiWhiteSpace(' ')
- PsiElement(MUL)('*')
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ PsiElement(is)('is')
PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- PsiElement(is)('is')
+ BINDING_PATTERN
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
- EXPRESSION_PATTERN
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
+ PROPERTY
+ PsiElement(val)('val')
PsiWhiteSpace(' ')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('2')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- PsiElement(is)('is')
+ PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
- TYPE_PATTERN
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
+ WHEN_CONDITION_IS_PATTERN
+ PsiElement(is)('is')
PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
+ TYPE_PATTERN
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ PsiElement(is)('is')
PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- PsiElement(is)('is')
+ WILDCARD_PATTERN
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
- DECOMPOSER_PATTERN
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiWhiteSpace(' ')
- DECOMPOSER_ARGUMENT_LIST
- PsiElement(HASH)('#')
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
+ PsiElement(MUL)('*')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ PsiElement(is)('is')
PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
+ EXPRESSION_PATTERN
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('2')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ PsiElement(is)('is')
PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiWhiteSpace('\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ TYPE_PATTERN
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ PsiElement(is)('is')
+ PsiWhiteSpace(' ')
+ DECOMPOSER_PATTERN
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ DECOMPOSER_ARGUMENT_LIST
+ PsiElement(HASH)('#')
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiWhiteSpace('\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/Attributes_ERR.txt b/compiler/testData/psi/Attributes_ERR.txt
index 9a1cb87e2ca..6c5ccaa76e3 100644
--- a/compiler/testData/psi/Attributes_ERR.txt
+++ b/compiler/testData/psi/Attributes_ERR.txt
@@ -1,54 +1,120 @@
JetFile: Attributes_ERR.jet
- NAMESPACE
- NAMESPACE_HEADER
- PsiElement(namespace)('package')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(DOT)('.')
- PsiElement(IDENTIFIER)('goo')
- PsiWhiteSpace('\n\n')
- CLASS
- MODIFIER_LIST
- PsiElement(abstract)('abstract')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(enum)('enum')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(annotation)('annotation')
- PsiWhiteSpace('\n')
- PsiElement(override)('override')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(abstract)('abstract')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- PsiErrorElement:Expecting a list of attributes
-
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- PsiElement(private)('private')
- PsiWhiteSpace('\n')
- PsiElement(protected)('protected')
- PsiWhiteSpace('\n')
- PsiElement(public)('public')
- PsiWhiteSpace('\n')
- PsiElement(internal)('internal')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
+ NAMESPACE_HEADER
+ PsiElement(namespace)('package')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(DOT)('.')
+ PsiElement(IDENTIFIER)('goo')
+ PsiWhiteSpace('\n\n')
+ CLASS
+ MODIFIER_LIST
+ PsiElement(abstract)('abstract')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(enum)('enum')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(annotation)('annotation')
+ PsiWhiteSpace('\n')
+ PsiElement(override)('override')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(abstract)('abstract')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ PsiErrorElement:Expecting a list of attributes
+
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ PsiElement(private)('private')
+ PsiWhiteSpace('\n')
+ PsiElement(protected)('protected')
+ PsiWhiteSpace('\n')
+ PsiElement(public)('public')
+ PsiWhiteSpace('\n')
+ PsiElement(internal)('internal')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('A')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('B')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RPAR)(')')
+ PsiErrorElement:No commas needed to separate attributes
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('ina')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
USER_TYPE
+ USER_TYPE
+ USER_TYPE
+ USER_TYPE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('goo')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('doo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ PsiElement(GT)('>')
+ PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
TYPE_ARGUMENT_LIST
@@ -57,218 +123,151 @@ JetFile: Attributes_ERR.jet
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('A')
+ PsiElement(IDENTIFIER)('bar')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('B')
+ PsiElement(IDENTIFIER)('goo')
PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
+ PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(RPAR)(')')
- PsiErrorElement:No commas needed to separate attributes
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('ina')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
+ PsiElement(IDENTIFIER)('df')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ PsiElement(in)('in')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('sdfsdf')
+ PsiWhiteSpace(' ')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('s')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('fd')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiErrorElement:No commas needed to separate attributes
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ PsiElement(out)('out')
+ PsiWhiteSpace('\n')
+ PsiElement(ref)('ref')
+ PsiWhiteSpace('\n ')
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('Bar')
+ TYPE_PARAMETER_LIST
+ PsiElement(LT)('<')
+ TYPE_PARAMETER
+ MODIFIER_LIST
+ PsiElement(abstract)('abstract')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(enum)('enum')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(annotation)('annotation')
+ PsiWhiteSpace('\n')
+ PsiElement(override)('override')
+ PsiWhiteSpace('\n')
+ PsiElement(open)('open')
+ PsiWhiteSpace('\n')
+ PsiElement(abstract)('abstract')
+ PsiWhiteSpace('\n')
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('sdfsd')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('sdfsd')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
USER_TYPE
USER_TYPE
USER_TYPE
USER_TYPE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
+ PsiElement(IDENTIFIER)('a')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('goo')
+ PsiElement(IDENTIFIER)('b')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('doo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiElement(GT)('>')
+ PsiElement(IDENTIFIER)('f')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('goo')
- PsiElement(GT)('>')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('df')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- PsiElement(in)('in')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('sdfsdf')
- PsiWhiteSpace(' ')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('s')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('fd')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiErrorElement:No commas needed to separate attributes
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- PsiElement(out)('out')
- PsiWhiteSpace('\n')
- PsiElement(ref)('ref')
- PsiWhiteSpace('\n ')
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('Bar')
- TYPE_PARAMETER_LIST
- PsiElement(LT)('<')
- TYPE_PARAMETER
- MODIFIER_LIST
- PsiElement(abstract)('abstract')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(enum)('enum')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(annotation)('annotation')
- PsiWhiteSpace('\n')
- PsiElement(override)('override')
- PsiWhiteSpace('\n')
- PsiElement(open)('open')
- PsiWhiteSpace('\n')
- PsiElement(abstract)('abstract')
- PsiWhiteSpace('\n')
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('sdfsd')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('sdfsd')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- USER_TYPE
- USER_TYPE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- PsiElement(private)('private')
- PsiWhiteSpace('\n')
- PsiElement(protected)('protected')
- PsiWhiteSpace('\n')
- PsiElement(public)('public')
- PsiWhiteSpace('\n')
- PsiElement(internal)('internal')
- PsiWhiteSpace('\n')
- PsiElement(in)('in')
- PsiWhiteSpace('\n')
- PsiElement(out)('out')
- PsiWhiteSpace('\n')
- PsiElement(ref)('ref')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiElement(IDENTIFIER)('c')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ PsiElement(private)('private')
+ PsiWhiteSpace('\n')
+ PsiElement(protected)('protected')
+ PsiWhiteSpace('\n')
+ PsiElement(public)('public')
+ PsiWhiteSpace('\n')
+ PsiElement(internal)('internal')
+ PsiWhiteSpace('\n')
+ PsiElement(in)('in')
+ PsiWhiteSpace('\n')
+ PsiElement(out)('out')
+ PsiWhiteSpace('\n')
+ PsiElement(ref)('ref')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/BabySteps.txt b/compiler/testData/psi/BabySteps.txt
index 237827701cd..4031aa393da 100644
--- a/compiler/testData/psi/BabySteps.txt
+++ b/compiler/testData/psi/BabySteps.txt
@@ -1,80 +1,79 @@
JetFile: BabySteps.jet
- NAMESPACE
- NAMESPACE_HEADER
- PsiElement(namespace)('package')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace('\n\n')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('Runnable')
- TYPE_PARAMETER_LIST
- PsiElement(LT)('<')
- TYPE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- TYPE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(GT)('>')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('doo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('0')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_SUPER_CALL
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- VALUE_ARGUMENT_NAME
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiElement(EQ)('=')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('0')
- PsiElement(RPAR)(')')
- PsiElement(COMMA)(',')
+ NAMESPACE_HEADER
+ PsiElement(namespace)('package')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace('\n\n')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('Runnable')
+ TYPE_PARAMETER_LIST
+ PsiElement(LT)('<')
+ TYPE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ TYPE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(GT)('>')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
- DELEGATOR_BY
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiWhiteSpace(' ')
- PsiElement(by)('by')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('x')
- PsiElement(COMMA)(',')
+ PsiElement(COLON)(':')
PsiWhiteSpace(' ')
- DELEGATOR_SUPER_CLASS
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('doo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('0')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_SUPER_CALL
+ CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ VALUE_ARGUMENT_NAME
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiElement(EQ)('=')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('0')
+ PsiElement(RPAR)(')')
+ PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ DELEGATOR_BY
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiWhiteSpace(' ')
+ PsiElement(by)('by')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('x')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ DELEGATOR_SUPER_CLASS
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/BabySteps_ERR.txt b/compiler/testData/psi/BabySteps_ERR.txt
index 4838223fe42..c961672268c 100644
--- a/compiler/testData/psi/BabySteps_ERR.txt
+++ b/compiler/testData/psi/BabySteps_ERR.txt
@@ -1,82 +1,81 @@
JetFile: BabySteps_ERR.jet
- NAMESPACE
- NAMESPACE_HEADER
- PsiElement(namespace)('package')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace('\n\n')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('Runnable')
- TYPE_PARAMETER_LIST
- PsiElement(LT)('<')
- TYPE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- TYPE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(GT)('>')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('doo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('0')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_SUPER_CALL
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- VALUE_ARGUMENT_NAME
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiElement(EQ)('=')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('0')
- PsiElement(RPAR)(')')
- PsiElement(COMMA)(',')
+ NAMESPACE_HEADER
+ PsiElement(namespace)('package')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace('\n\n')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('Runnable')
+ TYPE_PARAMETER_LIST
+ PsiElement(LT)('<')
+ TYPE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ TYPE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(GT)('>')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
- PsiErrorElement:Expecting a delegation specifier
- PsiElement(COMMA)(',')
- DELEGATOR_BY
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiWhiteSpace(' ')
- PsiElement(by)('by')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('x')
- PsiElement(COMMA)(',')
+ PsiElement(COLON)(':')
PsiWhiteSpace(' ')
- DELEGATOR_SUPER_CLASS
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('doo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('0')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_SUPER_CALL
+ CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ VALUE_ARGUMENT_NAME
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiElement(EQ)('=')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('0')
+ PsiElement(RPAR)(')')
+ PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiErrorElement:Expecting a delegation specifier
+ PsiElement(COMMA)(',')
+ DELEGATOR_BY
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiWhiteSpace(' ')
+ PsiElement(by)('by')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('x')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ DELEGATOR_SUPER_CLASS
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/ByCaluses.txt b/compiler/testData/psi/ByCaluses.txt
index 0778b080397..baa18e969f7 100644
--- a/compiler/testData/psi/ByCaluses.txt
+++ b/compiler/testData/psi/ByCaluses.txt
@@ -1,156 +1,205 @@
JetFile: ByCaluses.jet
- NAMESPACE
- NAMESPACE_HEADER
+ NAMESPACE_HEADER
+
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('A')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('A')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_BY
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace(' ')
- PsiElement(by)('by')
- PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_BY
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace(' ')
+ PsiElement(by)('by')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('A')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_BY
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace(' ')
+ PsiElement(by)('by')
+ PsiWhiteSpace(' ')
+ BINARY_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('A')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_BY
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace(' ')
- PsiElement(by)('by')
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
BINARY_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
- PsiElement(PLUS)('+')
+ PsiElement(MUL)('*')
PsiWhiteSpace(' ')
- BINARY_EXPRESSION
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- OPERATION_REFERENCE
- PsiElement(MUL)('*')
- PsiWhiteSpace(' ')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('5')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('A')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_BY
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace(' ')
- PsiElement(by)('by')
- PsiWhiteSpace(' ')
- PARENTHESIZED
- PsiElement(LPAR)('(')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('5')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('A')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_BY
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace(' ')
+ PsiElement(by)('by')
+ PsiWhiteSpace(' ')
+ PARENTHESIZED
+ PsiElement(LPAR)('(')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('A')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_BY
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace(' ')
+ PsiElement(by)('by')
+ PsiWhiteSpace(' ')
+ PARENTHESIZED
+ PsiElement(LPAR)('(')
+ CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('A')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_BY
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace(' ')
- PsiElement(by)('by')
- PsiWhiteSpace(' ')
- PARENTHESIZED
- PsiElement(LPAR)('(')
+ PsiWhiteSpace(' ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('A')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_BY
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace(' ')
+ PsiElement(by)('by')
+ PsiWhiteSpace(' ')
+ ARRAY_ACCESS_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ INDICES
+ PsiElement(LBRACKET)('[')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
@@ -161,46 +210,47 @@ JetFile: ByCaluses.jet
BLOCK
PsiElement(RBRACE)('}')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('A')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_BY
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace(' ')
- PsiElement(by)('by')
- PsiWhiteSpace(' ')
- ARRAY_ACCESS_EXPRESSION
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('A')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_BY
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- INDICES
- PsiElement(LBRACKET)('[')
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace(' ')
+ PsiElement(by)('by')
+ PsiWhiteSpace(' ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
@@ -211,47 +261,58 @@ JetFile: ByCaluses.jet
BLOCK
PsiElement(RBRACE)('}')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('A')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_BY
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace(' ')
- PsiElement(by)('by')
- PsiWhiteSpace(' ')
- CALL_EXPRESSION
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('A')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_BY
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace(' ')
+ PsiElement(by)('by')
+ PsiWhiteSpace(' ')
+ OBJECT_LITERAL
+ OBJECT_DECLARATION
+ PsiElement(object)('object')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('f')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
@@ -262,82 +323,20 @@ JetFile: ByCaluses.jet
BLOCK
PsiElement(RBRACE)('}')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('A')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_BY
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace(' ')
- PsiElement(by)('by')
- PsiWhiteSpace(' ')
- OBJECT_LITERAL
- OBJECT_DECLARATION
- PsiElement(object)('object')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('f')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/CallWithManyClosures.txt b/compiler/testData/psi/CallWithManyClosures.txt
index d7516b299ae..4fa8128e036 100644
--- a/compiler/testData/psi/CallWithManyClosures.txt
+++ b/compiler/testData/psi/CallWithManyClosures.txt
@@ -1,228 +1,227 @@
JetFile: CallWithManyClosures.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- PROPERTY
- PsiElement(val)('val')
+ NAMESPACE_HEADER
+
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
- CALL_EXPRESSION
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ PsiWhiteSpace(' ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace(' ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace(' ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ PsiWhiteSpace(' ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ CALL_EXPRESSION
+ PARENTHESIZED
+ PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('f')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PROPERTY
- PsiElement(val)('val')
+ PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
- CALL_EXPRESSION
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ CALL_EXPRESSION
+ PARENTHESIZED
+ PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('f')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PROPERTY
- PsiElement(val)('val')
+ PsiElement(RPAR)(')')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
- CALL_EXPRESSION
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ CALL_EXPRESSION
+ PARENTHESIZED
+ PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('f')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PROPERTY
- PsiElement(val)('val')
+ PsiElement(RPAR)(')')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('A')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PROPERTY
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- CALL_EXPRESSION
- PARENTHESIZED
- PsiElement(LPAR)('(')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PROPERTY
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- CALL_EXPRESSION
- PARENTHESIZED
- PsiElement(LPAR)('(')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiElement(RPAR)(')')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PROPERTY
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- CALL_EXPRESSION
- PARENTHESIZED
- PsiElement(LPAR)('(')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiElement(RPAR)(')')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('A')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/CallsInWhen.txt b/compiler/testData/psi/CallsInWhen.txt
index d67bce4cd23..7feb6a3648e 100644
--- a/compiler/testData/psi/CallsInWhen.txt
+++ b/compiler/testData/psi/CallsInWhen.txt
@@ -1,231 +1,230 @@
JetFile: CallsInWhen.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- VALUE_PARAMETER_LIST
+ NAMESPACE_HEADER
+
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ WHEN
+ PsiElement(when)('when')
+ PsiWhiteSpace(' ')
PsiElement(LPAR)('(')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
+ PsiWhiteSpace(' ')
PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- WHEN
- PsiElement(when)('when')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ EXPRESSION_PATTERN
+ DOT_QUALIFIED_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- EXPRESSION_PATTERN
- DOT_QUALIFIED_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ EXPRESSION_PATTERN
+ DOT_QUALIFIED_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(DOT)('.')
+ CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- EXPRESSION_PATTERN
- DOT_QUALIFIED_EXPRESSION
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ EXPRESSION_PATTERN
+ DOT_QUALIFIED_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(DOT)('.')
+ CALL_EXPRESSION
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- EXPRESSION_PATTERN
- DOT_QUALIFIED_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ EXPRESSION_PATTERN
+ DOT_QUALIFIED_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(DOT)('.')
+ CALL_EXPRESSION
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- EXPRESSION_PATTERN
- DOT_QUALIFIED_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ EXPRESSION_PATTERN
+ DOT_QUALIFIED_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(DOT)('.')
+ CALL_EXPRESSION
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- EXPRESSION_PATTERN
- DOT_QUALIFIED_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('d')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- EXPRESSION_PATTERN
- DOT_QUALIFIED_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('d')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ EXPRESSION_PATTERN
+ DOT_QUALIFIED_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(DOT)('.')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ EXPRESSION_PATTERN
+ DOT_QUALIFIED_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(DOT)('.')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(EXCL)('!')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- EXPRESSION_PATTERN
- DOT_QUALIFIED_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(EXCL)('!')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- WHEN_CONDITION_IS_PATTERN
- EXPRESSION_PATTERN
- DOT_QUALIFIED_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(DOT)('.')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(EXCL)('!')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- WHEN_ENTRY
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ WHEN_CONDITION_IS_PATTERN
+ EXPRESSION_PATTERN
+ DOT_QUALIFIED_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(DOT)('.')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(EXCL)('!')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ WHEN_ENTRY
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/Constructors.txt b/compiler/testData/psi/Constructors.txt
index 1a133292303..dc1ca863673 100644
--- a/compiler/testData/psi/Constructors.txt
+++ b/compiler/testData/psi/Constructors.txt
@@ -1,233 +1,232 @@
JetFile: Constructors.jet
- NAMESPACE
- NAMESPACE_HEADER
+ NAMESPACE_HEADER
+
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- INITIALIZER_LIST
- THIS_CALL
- THIS_CONSTRUCTOR_REFERENCE
- PsiElement(this)('this')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiElement(RPAR)(')')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- DELEGATOR_SUPER_CALL
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Foo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n\n ')
- CONSTRUCTOR
- PsiElement(this)('this')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('foo')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ INITIALIZER_LIST
+ THIS_CALL
+ THIS_CONSTRUCTOR_REFERENCE
+ PsiElement(this)('this')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('c')
+ PsiElement(RPAR)(')')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ DELEGATOR_SUPER_CALL
+ CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- INITIALIZER_LIST
- THIS_CALL
- THIS_CONSTRUCTOR_REFERENCE
- PsiElement(this)('this')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiElement(RPAR)(')')
- PsiElement(COMMA)(',')
+ PsiElement(IDENTIFIER)('Foo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n\n ')
+ CONSTRUCTOR
+ PsiElement(this)('this')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
- DELEGATOR_SUPER_CALL
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Foo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(RPAR)(')')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ INITIALIZER_LIST
+ THIS_CALL
+ THIS_CONSTRUCTOR_REFERENCE
+ PsiElement(this)('this')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('c')
+ PsiElement(RPAR)(')')
+ PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n')
- CLASS
- MODIFIER_LIST
- PsiElement(public)('public')
- PsiWhiteSpace(' ')
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- TYPE_PARAMETER_LIST
-
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_SUPER_CLASS
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
- PsiWhiteSpace('\n')
- CLASS
- MODIFIER_LIST
- PsiElement(protected)('protected')
- PsiWhiteSpace(' ')
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PRIMARY_CONSTRUCTOR_MODIFIER_LIST
- PsiElement(private)('private')
- PsiWhiteSpace(' ')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_SUPER_CLASS
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
- PsiWhiteSpace('\n')
- CLASS
- MODIFIER_LIST
- PsiElement(private)('private')
- PsiWhiteSpace(' ')
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- TYPE_PARAMETER_LIST
- PsiElement(LT)('<')
- TYPE_PARAMETER
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_SUPER_CLASS
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
- PsiWhiteSpace('\n')
- CLASS
- MODIFIER_LIST
- PsiElement(internal)('internal')
- PsiWhiteSpace(' ')
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- TYPE_PARAMETER_LIST
- PsiElement(LT)('<')
- TYPE_PARAMETER
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- PsiWhiteSpace(' ')
- PRIMARY_CONSTRUCTOR_MODIFIER_LIST
- PsiElement(private)('private')
- PsiWhiteSpace(' ')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- DELEGATION_SPECIFIER_LIST
- DELEGATOR_SUPER_CLASS
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
\ No newline at end of file
+ DELEGATOR_SUPER_CALL
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Foo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n')
+ CLASS
+ MODIFIER_LIST
+ PsiElement(public)('public')
+ PsiWhiteSpace(' ')
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_PARAMETER_LIST
+
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_SUPER_CLASS
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
+ PsiWhiteSpace('\n')
+ CLASS
+ MODIFIER_LIST
+ PsiElement(protected)('protected')
+ PsiWhiteSpace(' ')
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PRIMARY_CONSTRUCTOR_MODIFIER_LIST
+ PsiElement(private)('private')
+ PsiWhiteSpace(' ')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_SUPER_CLASS
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
+ PsiWhiteSpace('\n')
+ CLASS
+ MODIFIER_LIST
+ PsiElement(private)('private')
+ PsiWhiteSpace(' ')
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_PARAMETER_LIST
+ PsiElement(LT)('<')
+ TYPE_PARAMETER
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_SUPER_CLASS
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
+ PsiWhiteSpace('\n')
+ CLASS
+ MODIFIER_LIST
+ PsiElement(internal)('internal')
+ PsiWhiteSpace(' ')
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_PARAMETER_LIST
+ PsiElement(LT)('<')
+ TYPE_PARAMETER
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ PsiWhiteSpace(' ')
+ PRIMARY_CONSTRUCTOR_MODIFIER_LIST
+ PsiElement(private)('private')
+ PsiWhiteSpace(' ')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ DELEGATION_SPECIFIER_LIST
+ DELEGATOR_SUPER_CLASS
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
\ No newline at end of file
diff --git a/compiler/testData/psi/ControlStructures.txt b/compiler/testData/psi/ControlStructures.txt
index 7f0b690968b..04a121bde77 100644
--- a/compiler/testData/psi/ControlStructures.txt
+++ b/compiler/testData/psi/ControlStructures.txt
@@ -1,991 +1,990 @@
JetFile: ControlStructures.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('a')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiWhiteSpace('\n ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
+ NAMESPACE_HEADER
+
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('a')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiWhiteSpace('\n ')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ THROW
+ PsiElement(throw)('throw')
PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- THROW
- PsiElement(throw)('throw')
- PsiWhiteSpace(' ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Foo')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiElement(COMMA)(',')
- PsiWhiteSpace('\n ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- RETURN
- PsiElement(return)('return')
- PsiWhiteSpace(' ')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('10')
- PsiElement(COMMA)(',')
- PsiWhiteSpace('\n ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- BREAK
- PsiElement(break)('break')
- PsiElement(COMMA)(',')
- PsiWhiteSpace('\n ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- BREAK
- PsiElement(break)('break')
- PsiWhiteSpace(' ')
- LABEL_QUALIFIER
- LABEL_REFERENCE
- PsiElement(LABEL_IDENTIFIER)('@la')
- PsiElement(COMMA)(',')
- PsiWhiteSpace('\n ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- CONTINUE
- PsiElement(continue)('continue')
- PsiElement(COMMA)(',')
- PsiWhiteSpace('\n ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- CONTINUE
- PsiElement(continue)('continue')
- PsiWhiteSpace(' ')
- LABEL_QUALIFIER
- LABEL_REFERENCE
- PsiElement(LABEL_IDENTIFIER)('@la')
- PsiElement(COMMA)(',')
- PsiWhiteSpace('\n ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('10')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiElement(COMMA)(',')
- PsiWhiteSpace('\n ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('10')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace('\n')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Foo')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace('\n ')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
RETURN
PsiElement(return)('return')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('10')
- PsiWhiteSpace('\n ')
- RETURN
- PsiElement(return)('return')
- PsiWhiteSpace('\n ')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace('\n ')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ BREAK
+ PsiElement(break)('break')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace('\n ')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ BREAK
+ PsiElement(break)('break')
+ PsiWhiteSpace(' ')
+ LABEL_QUALIFIER
+ LABEL_REFERENCE
+ PsiElement(LABEL_IDENTIFIER)('@la')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace('\n ')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ CONTINUE
+ PsiElement(continue)('continue')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace('\n ')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ CONTINUE
+ PsiElement(continue)('continue')
+ PsiWhiteSpace(' ')
+ LABEL_QUALIFIER
+ LABEL_REFERENCE
+ PsiElement(LABEL_IDENTIFIER)('@la')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace('\n ')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('10')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace('\n ')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('10')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace('\n')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ RETURN
+ PsiElement(return)('return')
+ PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('10')
+ PsiWhiteSpace('\n ')
+ RETURN
+ PsiElement(return)('return')
+ PsiWhiteSpace('\n ')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('10')
+ PsiWhiteSpace('\n ')
+ BREAK
+ PsiElement(break)('break')
+ PsiWhiteSpace('\n ')
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(LABEL_IDENTIFIER)('@la')
PsiWhiteSpace('\n ')
BREAK
PsiElement(break)('break')
- PsiWhiteSpace('\n ')
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(LABEL_IDENTIFIER)('@la')
- PsiWhiteSpace('\n ')
- BREAK
- PsiElement(break)('break')
- PsiWhiteSpace(' ')
- LABEL_QUALIFIER
- LABEL_REFERENCE
- PsiElement(LABEL_IDENTIFIER)('@la')
+ PsiWhiteSpace(' ')
+ LABEL_QUALIFIER
+ LABEL_REFERENCE
+ PsiElement(LABEL_IDENTIFIER)('@la')
+ PsiWhiteSpace('\n ')
+ CONTINUE
+ PsiElement(continue)('continue')
+ PsiWhiteSpace('\n ')
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(LABEL_IDENTIFIER)('@la')
PsiWhiteSpace('\n ')
CONTINUE
PsiElement(continue)('continue')
- PsiWhiteSpace('\n ')
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(LABEL_IDENTIFIER)('@la')
- PsiWhiteSpace('\n ')
- CONTINUE
- PsiElement(continue)('continue')
- PsiWhiteSpace(' ')
- LABEL_QUALIFIER
- LABEL_REFERENCE
- PsiElement(LABEL_IDENTIFIER)('@la')
- PsiWhiteSpace('\n ')
- IF
- PsiElement(if)('if')
PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiWhiteSpace('\n ')
- PsiElement(else)('else')
- PsiWhiteSpace('\n ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace('\n ')
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- ELSE
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiWhiteSpace('\n ')
- PsiElement(else)('else')
- PsiWhiteSpace('\n ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiWhiteSpace('\n\n ')
- TRY
- PsiElement(try)('try')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CATCH
- PsiElement(catch)('catch')
- PsiWhiteSpace(' ')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('Foo')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- TRY
- PsiElement(try)('try')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CATCH
- PsiElement(catch)('catch')
- PsiWhiteSpace(' ')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('Foo')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CATCH
- PsiElement(catch)('catch')
- PsiWhiteSpace(' ')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('Foo')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CATCH
- PsiElement(catch)('catch')
- PsiWhiteSpace(' ')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('Foo')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- TRY
- PsiElement(try)('try')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CATCH
- PsiElement(catch)('catch')
- PsiWhiteSpace(' ')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('Foo')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CATCH
- PsiElement(catch)('catch')
- PsiWhiteSpace(' ')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('Foo')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bar')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FINALLY
- PsiElement(finally)('finally')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- TRY
- PsiElement(try)('try')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FINALLY
- PsiElement(finally)('finally')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FOR
- PsiElement(for)('for')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- LOOP_PARAMETER
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('x')
- PsiWhiteSpace(' ')
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- LOOP_RANGE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BODY
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- FOR
- PsiElement(for)('for')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- LOOP_PARAMETER
- PsiElement(IDENTIFIER)('x')
- PsiWhiteSpace(' ')
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- LOOP_RANGE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BODY
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- FOR
- PsiElement(for)('for')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- LOOP_PARAMETER
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('x')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Int')
- PsiWhiteSpace(' ')
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- LOOP_RANGE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BODY
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- FOR
- PsiElement(for)('for')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- LOOP_PARAMETER
- PsiElement(IDENTIFIER)('x')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Int')
- PsiWhiteSpace(' ')
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- LOOP_RANGE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BODY
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- WHILE
- PsiElement(while)('while')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- BOOLEAN_CONSTANT
- PsiElement(true)('true')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BODY
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- DO_WHILE
- PsiElement(do)('do')
- PsiWhiteSpace(' ')
- BODY
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace(' ')
- PsiElement(while)('while')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- BOOLEAN_CONSTANT
- PsiElement(false)('false')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n')
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- VALUE_PARAMETER_LIST
+ LABEL_QUALIFIER
+ LABEL_REFERENCE
+ PsiElement(LABEL_IDENTIFIER)('@la')
+ PsiWhiteSpace('\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
- FOR
- PsiElement(for)('for')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- LOOP_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- LOOP_RANGE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- BODY
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n\n ')
- FOR
- PsiElement(for)('for')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- LOOP_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- LOOP_RANGE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BODY
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FOR
- PsiElement(for)('for')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- LOOP_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- LOOP_RANGE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BODY
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FOR
- PsiElement(for)('for')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- LOOP_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- LOOP_RANGE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(RPAR)(')')
- BODY
-
- PsiElement(SEMICOLON)(';')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n\n ')
- WHILE
- PsiElement(while)('while')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- BINARY_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- OPERATION_REFERENCE
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- BODY
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n\n ')
- WHILE
- PsiElement(while)('while')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- BINARY_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- OPERATION_REFERENCE
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BODY
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- WHILE
- PsiElement(while)('while')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- BINARY_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- OPERATION_REFERENCE
- PsiElement(in)('in')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(RPAR)(')')
- BODY
-
- PsiElement(SEMICOLON)(';')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n\n ')
- WHILE
- PsiElement(while)('while')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BODY
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- PsiElement(else)('else')
- PsiWhiteSpace('\n ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiWhiteSpace('\n\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace(' ')
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiWhiteSpace('\n\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiWhiteSpace('\n\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(SEMICOLON)(';')
- PsiWhiteSpace('\n ')
- PsiElement(else)('else')
- PsiWhiteSpace('\n ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiElement(SEMICOLON)(';')
- PsiWhiteSpace('\n\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(SEMICOLON)(';')
- PsiWhiteSpace('\n\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- THEN
-
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiWhiteSpace('\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
-
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiWhiteSpace('\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
- PsiElement(SEMICOLON)(';')
- PsiWhiteSpace('\n ')
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- ELSE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('c')
- PsiWhiteSpace('\n ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- THEN
-
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- ELSE
-
- PsiElement(SEMICOLON)(';')
- PsiWhiteSpace('\n\n ')
- DO_WHILE
- PsiElement(do)('do')
- PsiWhiteSpace(' ')
- PsiElement(while)('while')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('r')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- DO_WHILE
- PsiElement(do)('do')
- PsiWhiteSpace(' ')
- BODY
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(while)('while')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('r')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- DO_WHILE
- PsiElement(do)('do')
- PsiWhiteSpace(' ')
- BODY
- BLOCK
- PsiElement(LBRACE)('{')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
+ THEN
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
- PsiElement(SEMICOLON)(';')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ THEN
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace('\n ')
+ PsiElement(else)('else')
+ PsiWhiteSpace('\n ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace('\n ')
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ ELSE
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiWhiteSpace('\n ')
+ PsiElement(else)('else')
+ PsiWhiteSpace('\n ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiWhiteSpace('\n\n ')
+ TRY
+ PsiElement(try)('try')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CATCH
+ PsiElement(catch)('catch')
+ PsiWhiteSpace(' ')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('Foo')
PsiWhiteSpace(' ')
- PsiElement(RBRACE)('}')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
+ PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
- PsiElement(while)('while')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ TRY
+ PsiElement(try)('try')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CATCH
+ PsiElement(catch)('catch')
PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('Foo')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CATCH
+ PsiElement(catch)('catch')
+ PsiWhiteSpace(' ')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('Foo')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CATCH
+ PsiElement(catch)('catch')
+ PsiWhiteSpace(' ')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('Foo')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ TRY
+ PsiElement(try)('try')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CATCH
+ PsiElement(catch)('catch')
+ PsiWhiteSpace(' ')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('Foo')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CATCH
+ PsiElement(catch)('catch')
+ PsiWhiteSpace(' ')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('Foo')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bar')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FINALLY
+ PsiElement(finally)('finally')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ TRY
+ PsiElement(try)('try')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FINALLY
+ PsiElement(finally)('finally')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ FOR
+ PsiElement(for)('for')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ LOOP_PARAMETER
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('x')
+ PsiWhiteSpace(' ')
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ LOOP_RANGE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BODY
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ FOR
+ PsiElement(for)('for')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ LOOP_PARAMETER
+ PsiElement(IDENTIFIER)('x')
+ PsiWhiteSpace(' ')
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ LOOP_RANGE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BODY
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ FOR
+ PsiElement(for)('for')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ LOOP_PARAMETER
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('x')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Int')
+ PsiWhiteSpace(' ')
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ LOOP_RANGE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BODY
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ FOR
+ PsiElement(for)('for')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ LOOP_PARAMETER
+ PsiElement(IDENTIFIER)('x')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Int')
+ PsiWhiteSpace(' ')
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ LOOP_RANGE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BODY
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ WHILE
+ PsiElement(while)('while')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ BOOLEAN_CONSTANT
+ PsiElement(true)('true')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BODY
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ DO_WHILE
+ PsiElement(do)('do')
+ PsiWhiteSpace(' ')
+ BODY
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace(' ')
+ PsiElement(while)('while')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ BOOLEAN_CONSTANT
+ PsiElement(false)('false')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n')
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ FOR
+ PsiElement(for)('for')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ LOOP_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ LOOP_RANGE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ BODY
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n\n ')
+ FOR
+ PsiElement(for)('for')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ LOOP_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ LOOP_RANGE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BODY
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ FOR
+ PsiElement(for)('for')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ LOOP_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ LOOP_RANGE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BODY
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('r')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ FOR
+ PsiElement(for)('for')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ LOOP_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ LOOP_RANGE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RPAR)(')')
+ BODY
+
+ PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n\n ')
+ WHILE
+ PsiElement(while)('while')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ BINARY_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ OPERATION_REFERENCE
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ BODY
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n\n ')
+ WHILE
+ PsiElement(while)('while')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ BINARY_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ OPERATION_REFERENCE
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BODY
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ WHILE
+ PsiElement(while)('while')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ BINARY_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ OPERATION_REFERENCE
+ PsiElement(in)('in')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RPAR)(')')
+ BODY
+
+ PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n\n ')
+ WHILE
+ PsiElement(while)('while')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BODY
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ PsiElement(else)('else')
+ PsiWhiteSpace('\n ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('c')
+ PsiWhiteSpace('\n\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace(' ')
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('c')
+ PsiWhiteSpace('\n\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('c')
+ PsiWhiteSpace('\n\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace('\n ')
+ PsiElement(else)('else')
+ PsiWhiteSpace('\n ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('c')
+ PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace('\n\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ THEN
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace('\n\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ THEN
+
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('c')
+ PsiWhiteSpace('\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ THEN
+
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('c')
+ PsiWhiteSpace('\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ THEN
+ PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace('\n ')
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ ELSE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('c')
+ PsiWhiteSpace('\n ')
+ IF
+ PsiElement(if)('if')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ THEN
+
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ ELSE
+
+ PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace('\n\n ')
+ DO_WHILE
+ PsiElement(do)('do')
+ PsiWhiteSpace(' ')
+ PsiElement(while)('while')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('r')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ DO_WHILE
+ PsiElement(do)('do')
+ PsiWhiteSpace(' ')
+ BODY
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(while)('while')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('r')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ DO_WHILE
+ PsiElement(do)('do')
+ PsiWhiteSpace(' ')
+ BODY
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(SEMICOLON)(';')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace(' ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace(' ')
+ PsiElement(while)('while')
+ PsiWhiteSpace(' ')
+ PsiElement(LPAR)('(')
+ CONDITION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('r')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/EOLsInComments.txt b/compiler/testData/psi/EOLsInComments.txt
index 5aed3791303..6e5482c96d2 100644
--- a/compiler/testData/psi/EOLsInComments.txt
+++ b/compiler/testData/psi/EOLsInComments.txt
@@ -1,108 +1,107 @@
JetFile: EOLsInComments.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
+ NAMESPACE_HEADER
+
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ PsiComment(DOC_COMMENT)('/** */')
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ PsiComment(BLOCK_COMMENT)('/* */')
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ BINARY_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- PsiComment(DOC_COMMENT)('/** */')
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
- PsiComment(BLOCK_COMMENT)('/* */')
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- BINARY_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiComment(BLOCK_COMMENT)('/*\n */')
- PsiWhiteSpace(' ')
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace('\n ')
+ PsiWhiteSpace(' ')
PsiComment(BLOCK_COMMENT)('/*\n */')
PsiWhiteSpace(' ')
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- BINARY_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiComment(DOC_COMMENT)('/**\n */')
- PsiWhiteSpace(' ')
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace('\n ')
+ PsiComment(BLOCK_COMMENT)('/*\n */')
+ PsiWhiteSpace(' ')
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ BINARY_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
- PsiComment(EOL_COMMENT)('//')
- PsiWhiteSpace('\n ')
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
+ PsiComment(DOC_COMMENT)('/**\n */')
+ PsiWhiteSpace(' ')
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
- PsiComment(EOL_COMMENT)('//')
- PsiWhiteSpace('\n')
- PREFIX_EXPRESSION
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiComment(EOL_COMMENT)('//')
+ PsiWhiteSpace('\n ')
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiComment(EOL_COMMENT)('//')
+ PsiWhiteSpace('\n')
+ PREFIX_EXPRESSION
+ OPERATION_REFERENCE
+ PsiElement(PLUS)('+')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/EOLsOnRollback.txt b/compiler/testData/psi/EOLsOnRollback.txt
index 6e085ffa275..c42e583c425 100644
--- a/compiler/testData/psi/EOLsOnRollback.txt
+++ b/compiler/testData/psi/EOLsOnRollback.txt
@@ -1,97 +1,96 @@
JetFile: EOLsOnRollback.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
+ NAMESPACE_HEADER
+
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace('\n ')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace('\n ')
- TYPE_PARAMETER_LIST
-
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- CLASS
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace('\n\n ')
- TYPE_PARAMETER_LIST
-
- TYPEDEF
- PsiElement(type)('type')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('x')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('t')
- PsiWhiteSpace('\n ')
- PROPERTY
- PsiElement(var)('var')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('r')
- PsiWhiteSpace('\n\n ')
- PROPERTY
- MODIFIER_LIST
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- PsiElement(var)('var')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('4')
+ TYPE_PARAMETER_LIST
+
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ CLASS
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace('\n\n ')
+ TYPE_PARAMETER_LIST
+
+ TYPEDEF
+ PsiElement(type)('type')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('x')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('t')
+ PsiWhiteSpace('\n ')
+ PROPERTY
+ PsiElement(var)('var')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('r')
+ PsiWhiteSpace('\n\n ')
+ PROPERTY
+ MODIFIER_LIST
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ PsiElement(var)('var')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- PsiWhiteSpace('\n ')
- PROPERTY
- MODIFIER_LIST
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('f')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiElement(INTEGER_LITERAL)('4')
+ PsiWhiteSpace('\n\n ')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ PsiWhiteSpace('\n ')
+ PROPERTY
+ MODIFIER_LIST
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('f')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/EmptyFile.txt b/compiler/testData/psi/EmptyFile.txt
index 3630ef98bd5..eaddc739910 100644
--- a/compiler/testData/psi/EmptyFile.txt
+++ b/compiler/testData/psi/EmptyFile.txt
@@ -1,4 +1,3 @@
JetFile: EmptyFile.jet
- NAMESPACE
- NAMESPACE_HEADER
-
\ No newline at end of file
+ NAMESPACE_HEADER
+
\ No newline at end of file
diff --git a/compiler/testData/psi/Enums.txt b/compiler/testData/psi/Enums.txt
index dfadca48ef1..2b986a89e88 100644
--- a/compiler/testData/psi/Enums.txt
+++ b/compiler/testData/psi/Enums.txt
@@ -1,195 +1,213 @@
JetFile: Enums.jet
- NAMESPACE
- NAMESPACE_HEADER
+ NAMESPACE_HEADER
+
+ CLASS
+ MODIFIER_LIST
+ PsiElement(enum)('enum')
+ PsiWhiteSpace(' ')
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('Color')
+ TYPE_PARAMETER_LIST
- CLASS
- MODIFIER_LIST
- PsiElement(enum)('enum')
- PsiWhiteSpace(' ')
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('Color')
- TYPE_PARAMETER_LIST
-
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('rgb')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Int')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- ENUM_ENTRY
- OBJECT_DECLARATION_NAME
- PsiElement(IDENTIFIER)('RED')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- INITIALIZER_LIST
- DELEGATOR_SUPER_CALL
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Color')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('0xFF000')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- ENUM_ENTRY
- OBJECT_DECLARATION_NAME
- PsiElement(IDENTIFIER)('GREEN')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- INITIALIZER_LIST
- DELEGATOR_SUPER_CALL
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Color')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('0x00FF00')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- ENUM_ENTRY
- OBJECT_DECLARATION_NAME
- PsiElement(IDENTIFIER)('BLUE')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- INITIALIZER_LIST
- DELEGATOR_SUPER_CALL
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Color')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('0x0000FF')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n')
- CLASS
- MODIFIER_LIST
- PsiElement(enum)('enum')
- PsiWhiteSpace(' ')
- PsiElement(class)('class')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('List')
- TYPE_PARAMETER_LIST
- PsiElement(LT)('<')
- TYPE_PARAMETER
- MODIFIER_LIST
- PsiElement(out)('out')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('size')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Int')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- CLASS_BODY
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- ENUM_ENTRY
- OBJECT_DECLARATION_NAME
- PsiElement(IDENTIFIER)('Nil')
- PsiWhiteSpace(' ')
- TYPE_PARAMETER_LIST
-
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- INITIALIZER_LIST
- DELEGATOR_SUPER_CALL
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('List')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Nothing')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('0')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n\n ')
- ENUM_ENTRY
- OBJECT_DECLARATION_NAME
- PsiElement(IDENTIFIER)('Cons')
- TYPE_PARAMETER_LIST
- PsiElement(LT)('<')
- TYPE_PARAMETER
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('value')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('rgb')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Int')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ ENUM_ENTRY
+ OBJECT_DECLARATION_NAME
+ PsiElement(IDENTIFIER)('RED')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ INITIALIZER_LIST
+ DELEGATOR_SUPER_CALL
+ CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(COMMA)(',')
+ PsiElement(IDENTIFIER)('Color')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('0xFF000')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ ENUM_ENTRY
+ OBJECT_DECLARATION_NAME
+ PsiElement(IDENTIFIER)('GREEN')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ INITIALIZER_LIST
+ DELEGATOR_SUPER_CALL
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Color')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('0x00FF00')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ ENUM_ENTRY
+ OBJECT_DECLARATION_NAME
+ PsiElement(IDENTIFIER)('BLUE')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ INITIALIZER_LIST
+ DELEGATOR_SUPER_CALL
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Color')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('0x0000FF')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n')
+ CLASS
+ MODIFIER_LIST
+ PsiElement(enum)('enum')
+ PsiWhiteSpace(' ')
+ PsiElement(class)('class')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('List')
+ TYPE_PARAMETER_LIST
+ PsiElement(LT)('<')
+ TYPE_PARAMETER
+ MODIFIER_LIST
+ PsiElement(out)('out')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('size')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Int')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ CLASS_BODY
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ ENUM_ENTRY
+ OBJECT_DECLARATION_NAME
+ PsiElement(IDENTIFIER)('Nil')
+ PsiWhiteSpace(' ')
+ TYPE_PARAMETER_LIST
+
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ INITIALIZER_LIST
+ DELEGATOR_SUPER_CALL
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('List')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Nothing')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('0')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n\n ')
+ ENUM_ENTRY
+ OBJECT_DECLARATION_NAME
+ PsiElement(IDENTIFIER)('Cons')
+ TYPE_PARAMETER_LIST
+ PsiElement(LT)('<')
+ TYPE_PARAMETER
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(val)('val')
PsiWhiteSpace(' ')
- VALUE_PARAMETER
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('tail')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('value')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_PARAMETER
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('tail')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('List')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(GT)('>')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ INITIALIZER_LIST
+ DELEGATOR_SUPER_CALL
+ CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
@@ -202,55 +220,36 @@ JetFile: Enums.jet
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- INITIALIZER_LIST
- DELEGATOR_SUPER_CALL
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('List')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- PsiComment(BLOCK_COMMENT)('/*tail.size + 1*/')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n\n ')
- PROPERTY
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('isEmpty')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Bool')
- PsiWhiteSpace('\n ')
- PROPERTY_ACCESSOR
- PsiElement(get)('get')
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('size')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ PsiComment(BLOCK_COMMENT)('/*tail.size + 1*/')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n\n ')
+ PROPERTY
+ PsiElement(val)('val')
PsiWhiteSpace(' ')
- PsiComment(EOL_COMMENT)('//> 0')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiElement(IDENTIFIER)('isEmpty')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Bool')
+ PsiWhiteSpace('\n ')
+ PROPERTY_ACCESSOR
+ PsiElement(get)('get')
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('size')
+ PsiWhiteSpace(' ')
+ PsiComment(EOL_COMMENT)('//> 0')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/Expressions_ERR.txt b/compiler/testData/psi/Expressions_ERR.txt
index a9b043e82a6..56f14f20935 100644
--- a/compiler/testData/psi/Expressions_ERR.txt
+++ b/compiler/testData/psi/Expressions_ERR.txt
@@ -1,59 +1,58 @@
JetFile: Expressions_ERR.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- PROPERTY
- PsiElement(val)('val')
+ NAMESPACE_HEADER
+
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('f')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ IF
+ PsiElement(if)('if')
PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('f')
+ PsiElement(LPAR)('(')
+ CONDITION
+ BOOLEAN_CONSTANT
+ PsiElement(true)('true')
+ PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
+ THEN
+ RETURN
+ PsiElement(return)('return')
PsiWhiteSpace(' ')
- IF
- PsiElement(if)('if')
- PsiWhiteSpace(' ')
- PsiElement(LPAR)('(')
- CONDITION
- BOOLEAN_CONSTANT
- PsiElement(true)('true')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- THEN
- RETURN
- PsiElement(return)('return')
- PsiWhiteSpace(' ')
- PsiElement(else)('else')
- PsiWhiteSpace(' ')
- ELSE
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('dfsd')
- PsiWhiteSpace('\n ')
- PsiErrorElement:Expecting an element
- PsiElement(RPAR)(')')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
- PsiErrorElement:Expecting an element
- PsiElement(RPAR)(')')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
- PsiErrorElement:Expecting an element
- PsiElement(BAD_CHARACTER)('~')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
- PsiElement(SEMICOLON)(';')
- PsiWhiteSpace('\n ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('srgsdfg')
- PsiWhiteSpace('\n\n ')
- PsiErrorElement:Expecting an element
- PsiElement(BAD_CHARACTER)('~')
- PsiWhiteSpace('\n\n ')
- PsiErrorElement:Expecting an element
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiElement(else)('else')
+ PsiWhiteSpace(' ')
+ ELSE
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('dfsd')
+ PsiWhiteSpace('\n ')
+ PsiErrorElement:Expecting an element
+ PsiElement(RPAR)(')')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiErrorElement:Expecting an element
+ PsiElement(RPAR)(')')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiErrorElement:Expecting an element
+ PsiElement(BAD_CHARACTER)('~')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiElement(SEMICOLON)(';')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('srgsdfg')
+ PsiWhiteSpace('\n\n ')
+ PsiErrorElement:Expecting an element
+ PsiElement(BAD_CHARACTER)('~')
+ PsiWhiteSpace('\n\n ')
+ PsiErrorElement:Expecting an element
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/ExtensionsWithQNReceiver.txt b/compiler/testData/psi/ExtensionsWithQNReceiver.txt
index 1baa3c557fc..95901f7809b 100644
--- a/compiler/testData/psi/ExtensionsWithQNReceiver.txt
+++ b/compiler/testData/psi/ExtensionsWithQNReceiver.txt
@@ -1,77 +1,76 @@
JetFile: ExtensionsWithQNReceiver.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- PROPERTY
- PsiElement(val)('val')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
+ NAMESPACE_HEADER
+
+ PROPERTY
+ PsiElement(val)('val')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
USER_TYPE
USER_TYPE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('java')
- PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('util')
+ PsiElement(IDENTIFIER)('java')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Map')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- PsiElement(MUL)('*')
- PsiElement(COMMA)(',')
- TYPE_PROJECTION
- PsiElement(MUL)('*')
- PsiElement(GT)('>')
- PsiElement(DOT)('.')
- PsiElement(IDENTIFIER)('size')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Int')
- PsiWhiteSpace('\n\n')
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
+ PsiElement(IDENTIFIER)('util')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Map')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ PsiElement(MUL)('*')
+ PsiElement(COMMA)(',')
+ TYPE_PROJECTION
+ PsiElement(MUL)('*')
+ PsiElement(GT)('>')
+ PsiElement(DOT)('.')
+ PsiElement(IDENTIFIER)('size')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Int')
+ PsiWhiteSpace('\n\n')
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
USER_TYPE
USER_TYPE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('java')
- PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('util')
+ PsiElement(IDENTIFIER)('java')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Map')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- PsiElement(MUL)('*')
- PsiElement(COMMA)(',')
- TYPE_PROJECTION
- PsiElement(MUL)('*')
- PsiElement(GT)('>')
- PsiElement(DOT)('.')
- PsiElement(IDENTIFIER)('size')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('Int')
- PsiWhiteSpace(' ')
- PsiElement(EQ)('=')
- PsiWhiteSpace(' ')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
\ No newline at end of file
+ PsiElement(IDENTIFIER)('util')
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Map')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ PsiElement(MUL)('*')
+ PsiElement(COMMA)(',')
+ TYPE_PROJECTION
+ PsiElement(MUL)('*')
+ PsiElement(GT)('>')
+ PsiElement(DOT)('.')
+ PsiElement(IDENTIFIER)('size')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('Int')
+ PsiWhiteSpace(' ')
+ PsiElement(EQ)('=')
+ PsiWhiteSpace(' ')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
\ No newline at end of file
diff --git a/compiler/testData/psi/FileStart_ERR.txt b/compiler/testData/psi/FileStart_ERR.txt
index bda36bd0a99..03b700f38f5 100644
--- a/compiler/testData/psi/FileStart_ERR.txt
+++ b/compiler/testData/psi/FileStart_ERR.txt
@@ -1,36 +1,35 @@
JetFile: FileStart_ERR.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- PsiErrorElement:Expecting namespace or top level declaration
- PsiElement(DIV)('/')
- PsiErrorElement:Expecting namespace or top level declaration
- PsiElement(namespace)('package')
- PsiWhiteSpace(' ')
- MODIFIER_LIST
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(DOT)('.')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('bar')
- PsiWhiteSpace('\n')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('import')
- PsiWhiteSpace(' ')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
+ NAMESPACE_HEADER
+
+ PsiErrorElement:Expecting namespace or top level declaration
+ PsiElement(DIV)('/')
+ PsiErrorElement:Expecting namespace or top level declaration
+ PsiElement(namespace)('package')
+ PsiWhiteSpace(' ')
+ MODIFIER_LIST
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
- PsiErrorElement:Expecting namespace or top level declaration
-
\ No newline at end of file
+ PsiElement(DOT)('.')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('bar')
+ PsiWhiteSpace('\n')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('import')
+ PsiWhiteSpace(' ')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiErrorElement:Expecting namespace or top level declaration
+
\ No newline at end of file
diff --git a/compiler/testData/psi/FunctionCalls.txt b/compiler/testData/psi/FunctionCalls.txt
index 94f67c99444..226682524cb 100644
--- a/compiler/testData/psi/FunctionCalls.txt
+++ b/compiler/testData/psi/FunctionCalls.txt
@@ -1,79 +1,67 @@
JetFile: FunctionCalls.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(GT)('>')
- PsiWhiteSpace('\n ')
- PARENTHESIZED
- PsiElement(LPAR)('(')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('s')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
+ NAMESPACE_HEADER
+
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('f')
- PsiWhiteSpace('\n ')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(GT)('>')
+ PsiWhiteSpace('\n ')
+ PARENTHESIZED
+ PsiElement(LPAR)('(')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ PsiWhiteSpace(' ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
@@ -81,51 +69,22 @@ JetFile: FunctionCalls.jet
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('s')
PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('s')
- PsiWhiteSpace('\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('s')
- PsiWhiteSpace('\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
+ PsiWhiteSpace('\n ')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('s')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ PsiWhiteSpace(' ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
@@ -135,53 +94,17 @@ JetFile: FunctionCalls.jet
PsiElement(IDENTIFIER)('s')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('s')
- PsiWhiteSpace('\n ')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
@@ -191,139 +114,215 @@ JetFile: FunctionCalls.jet
PsiElement(IDENTIFIER)('s')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(GT)('>')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- TYPE_ARGUMENT_LIST
- PsiElement(LT)('<')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- TYPE_PROJECTION
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- PsiElement(GT)('>')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- BINARY_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- OPERATION_REFERENCE
- PsiElement(LT)('<')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('s')
+ PsiWhiteSpace('\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
- BINARY_EXPRESSION
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('s')
+ PsiWhiteSpace('\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
- OPERATION_REFERENCE
- PsiElement(GT)('>')
- PARENTHESIZED
- PsiElement(LPAR)('(')
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('s')
+ PsiWhiteSpace('\n ')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(GT)('>')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ TYPE_ARGUMENT_LIST
+ PsiElement(LT)('<')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ TYPE_PROJECTION
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(GT)('>')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n ')
- CALL_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('f')
- VALUE_ARGUMENT_LIST
- PsiElement(LPAR)('(')
- VALUE_ARGUMENT
- BINARY_EXPRESSION
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- OPERATION_REFERENCE
- PsiElement(LT)('<')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
+ PsiElement(RPAR)(')')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ BINARY_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ OPERATION_REFERENCE
+ PsiElement(LT)('<')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ BINARY_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ OPERATION_REFERENCE
+ PsiElement(GT)('>')
PARENTHESIZED
PsiElement(LPAR)('(')
- BINARY_EXPRESSION
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- PsiWhiteSpace(' ')
- OPERATION_REFERENCE
- PsiElement(PLUS)('+')
- PsiWhiteSpace(' ')
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('2')
- PsiElement(RPAR)(')')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- VALUE_ARGUMENT
- BINARY_EXPRESSION
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('b')
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n ')
+ CALL_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('f')
+ VALUE_ARGUMENT_LIST
+ PsiElement(LPAR)('(')
+ VALUE_ARGUMENT
+ BINARY_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ OPERATION_REFERENCE
+ PsiElement(LT)('<')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ PARENTHESIZED
+ PsiElement(LPAR)('(')
+ BINARY_EXPRESSION
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('1')
+ PsiWhiteSpace(' ')
OPERATION_REFERENCE
- PsiElement(GT)('>')
- PARENTHESIZED
- PsiElement(LPAR)('(')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiElement(RPAR)(')')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
\ No newline at end of file
+ PsiElement(PLUS)('+')
+ PsiWhiteSpace(' ')
+ INTEGER_CONSTANT
+ PsiElement(INTEGER_LITERAL)('2')
+ PsiElement(RPAR)(')')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ VALUE_ARGUMENT
+ BINARY_EXPRESSION
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('b')
+ OPERATION_REFERENCE
+ PsiElement(GT)('>')
+ PARENTHESIZED
+ PsiElement(LPAR)('(')
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
\ No newline at end of file
diff --git a/compiler/testData/psi/FunctionLiterals.txt b/compiler/testData/psi/FunctionLiterals.txt
index 13fc16a5f1d..54831c53a0d 100644
--- a/compiler/testData/psi/FunctionLiterals.txt
+++ b/compiler/testData/psi/FunctionLiterals.txt
@@ -1,499 +1,498 @@
JetFile: FunctionLiterals.jet
- NAMESPACE
- NAMESPACE_HEADER
-
- FUN
- PsiElement(fun)('fun')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('foo')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- BLOCK
- PsiElement(LBRACE)('{')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
-
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('foo')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- 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(' ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- 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(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
+ NAMESPACE_HEADER
+
+ FUN
+ PsiElement(fun)('fun')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('foo')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ BLOCK
+ PsiElement(LBRACE)('{')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('foo')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- 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)(',')
+ PsiElement(COLON)(':')
PsiWhiteSpace(' ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('B')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- 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)(',')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('A')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(COMMA)(',')
+ PsiElement(COLON)(':')
PsiWhiteSpace(' ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('B')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('A')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ 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(' ')
- BLOCK
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('B')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ 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)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('B')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(DOT)('.')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(DOT)('.')
- 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(' ')
- BLOCK
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(DOT)('.')
- 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(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(DOT)('.')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ TYPE_REFERENCE
+ USER_TYPE
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiElement(DOT)('.')
- VALUE_PARAMETER_LIST
- PsiElement(LPAR)('(')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('a')
- PsiElement(RPAR)(')')
- PsiWhiteSpace(' ')
- PsiElement(COLON)(':')
- PsiWhiteSpace(' ')
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('T')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(DOT)('.')
+ 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(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(DOT)('.')
+ 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(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiElement(DOT)('.')
+ VALUE_PARAMETER_LIST
+ PsiElement(LPAR)('(')
+ VALUE_PARAMETER
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RPAR)(')')
+ PsiWhiteSpace(' ')
+ PsiElement(COLON)(':')
+ PsiWhiteSpace(' ')
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('T')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ BLOCK
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n\n ')
+ 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 ')
+ FUNCTION_LITERAL_EXPRESSION
+ FUNCTION_LITERAL
+ PsiElement(LBRACE)('{')
+ BLOCK
+ ANNOTATED_EXPRESSION
+ ANNOTATION
+ PsiElement(LBRACKET)('[')
+ ANNOTATION_ENTRY
+ CONSTRUCTOR_CALLEE
+ TYPE_REFERENCE
+ USER_TYPE
+ REFERENCE_EXPRESSION
+ PsiElement(IDENTIFIER)('a')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- VALUE_PARAMETER_LIST
- VALUE_PARAMETER
PsiElement(IDENTIFIER)('x')
+ PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
- VALUE_PARAMETER
- PsiElement(IDENTIFIER)('y')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- BLOCK
- INTEGER_CONSTANT
- PsiElement(INTEGER_LITERAL)('1')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n ')
- FUNCTION_LITERAL_EXPRESSION
- FUNCTION_LITERAL
- PsiElement(LBRACE)('{')
- BLOCK
- ANNOTATED_EXPRESSION
- ANNOTATION
- PsiElement(LBRACKET)('[')
- ANNOTATION_ENTRY
- CONSTRUCTOR_CALLEE
- TYPE_REFERENCE
- USER_TYPE
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('a')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- REFERENCE_EXPRESSION
- PsiElement(IDENTIFIER)('x')
- PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- PsiElement(LBRACKET)('[')
- PsiElement(IDENTIFIER)('b')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('y')
- PsiElement(COMMA)(',')
- PsiWhiteSpace(' ')
- PsiElement(LBRACKET)('[')
- PsiElement(IDENTIFIER)('c')
- PsiElement(RBRACKET)(']')
- PsiWhiteSpace(' ')
- PsiElement(IDENTIFIER)('z')
- PsiWhiteSpace(' ')
- PsiElement(ARROW)('->')
- PsiWhiteSpace(' ')
- PsiElement(INTEGER_LITERAL)('1')
- PsiElement(RBRACE)('}')
- PsiWhiteSpace('\n')
- PsiElement(RBRACE)('}')
- PsiErrorElement:Expecting '}
-
\ No newline at end of file
+ PsiElement(LBRACKET)('[')
+ PsiElement(IDENTIFIER)('b')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('y')
+ PsiElement(COMMA)(',')
+ PsiWhiteSpace(' ')
+ PsiElement(LBRACKET)('[')
+ PsiElement(IDENTIFIER)('c')
+ PsiElement(RBRACKET)(']')
+ PsiWhiteSpace(' ')
+ PsiElement(IDENTIFIER)('z')
+ PsiWhiteSpace(' ')
+ PsiElement(ARROW)('->')
+ PsiWhiteSpace(' ')
+ PsiElement(INTEGER_LITERAL)('1')
+ PsiElement(RBRACE)('}')
+ PsiWhiteSpace('\n')
+ PsiElement(RBRACE)('}')
+ PsiErrorElement:Expecting '}
+