diff --git a/.idea/ant.xml b/.idea/ant.xml index 24adafcd5c7..ed038767c6b 100644 --- a/.idea/ant.xml +++ b/.idea/ant.xml @@ -10,14 +10,6 @@ - - - - - - - - diff --git a/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java b/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java index c1395d86f5f..8617f13f719 100644 --- a/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java +++ b/build-tools/core/src/org/jetbrains/jet/buildtools/core/BytecodeCompiler.java @@ -18,9 +18,7 @@ package org.jetbrains.jet.buildtools.core; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.compiler.CompileEnvironment; -import org.jetbrains.jet.compiler.CompileEnvironmentException; -import org.jetbrains.jet.compiler.CompilerPlugin; +import org.jetbrains.jet.compiler.*; import org.jetbrains.jet.compiler.messages.MessageCollector; import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; @@ -42,26 +40,29 @@ public class BytecodeCompiler { /** - * Creates new instance of {@link CompileEnvironment} instance using the arguments specified. + * Creates new instance of {@link org.jetbrains.jet.compiler.CompileEnvironmentConfiguration} instance using the arguments specified. * * @param stdlib path to "kotlin-runtime.jar", only used if not null and not empty * @param classpath compilation classpath, only used if not null and not empty * * @return compile environment instance */ - private CompileEnvironment env( String stdlib, String[] classpath ) { - CompileEnvironment env = new CompileEnvironment(MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR, CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR)); + private CompileEnvironmentConfiguration env( String stdlib, String[] classpath ) { + CompilerDependencies dependencies = CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR); + JetCoreEnvironment environment = new JetCoreEnvironment(CompileEnvironmentUtil.createMockDisposable(), dependencies); + CompileEnvironmentConfiguration env = new CompileEnvironmentConfiguration(environment, dependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR); if (( stdlib != null ) && ( stdlib.trim().length() > 0 )) { - env.setStdlib( stdlib ); + File file = new File(stdlib); + CompileEnvironmentUtil.addToClasspath(env.getEnvironment(), file); } if (( classpath != null ) && ( classpath.length > 0 )) { - env.addToClasspath( classpath ); + CompileEnvironmentUtil.addToClasspath(env.getEnvironment(), classpath); } // lets register any compiler plugins - env.getEnvironment().getCompilerPlugins().addAll(getCompilerPlugins()); + env.getCompilerPlugins().addAll(getCompilerPlugins()); return env; } @@ -92,7 +93,8 @@ public class BytecodeCompiler { */ public void sourcesToDir ( @NotNull String src, @NotNull String output, @Nullable String stdlib, @Nullable String[] classpath ) { try { - boolean success = env( stdlib, classpath ).compileBunchOfSources( src, null, output, true /* Last arg is ignored anyway */ ); + boolean success = KotlinToJVMBytecodeCompiler.compileBunchOfSources(env(stdlib, classpath), src, null, output, true + /* Last arg is ignored anyway */); if ( ! success ) { throw new CompileEnvironmentException( errorMessage( src, false )); } @@ -114,7 +116,7 @@ public class BytecodeCompiler { */ public void sourcesToJar ( @NotNull String src, @NotNull String jar, boolean includeRuntime, @Nullable String stdlib, @Nullable String[] classpath ) { try { - boolean success = env( stdlib, classpath ).compileBunchOfSources( src, jar, null, includeRuntime ); + boolean success = KotlinToJVMBytecodeCompiler.compileBunchOfSources(env(stdlib, classpath), src, jar, null, includeRuntime); if ( ! success ) { throw new CompileEnvironmentException( errorMessage( src, false )); } @@ -136,7 +138,8 @@ public class BytecodeCompiler { */ public void moduleToJar ( @NotNull String module, @NotNull String jar, boolean includeRuntime, @Nullable String stdlib, @Nullable String[] classpath ) { try { - boolean success = env( stdlib, classpath ).compileModuleScript( module, jar, null, includeRuntime); + CompileEnvironmentConfiguration env = env(stdlib, classpath); + boolean success = KotlinToJVMBytecodeCompiler.compileModuleScript(env, module, jar, null, includeRuntime); if ( ! success ) { throw new CompileEnvironmentException( errorMessage( module, false )); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java index 89eddf97855..ea431b29b9b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBodyCodegen.java @@ -16,7 +16,6 @@ package org.jetbrains.jet.codegen; -import com.intellij.psi.PsiElement; import org.jetbrains.jet.lang.descriptors.ClassDescriptor; import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; import org.jetbrains.jet.lang.psi.*; @@ -148,7 +147,7 @@ public abstract class ClassBodyCodegen { private void generateStaticInitializer() { if (staticInitializerChunks.size() > 0) { final MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | Opcodes.ACC_STATIC,"", "()V", null, null); - if (v.generateCode() == ClassBuilder.Mode.FULL) { + if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter v = new InstructionAdapter(mv); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilder.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilder.java index 4fda5422ef4..12b51fe7ef7 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilder.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilder.java @@ -21,27 +21,24 @@ package org.jetbrains.jet.codegen; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.Nullable; -import org.objectweb.asm.*; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; public abstract class ClassBuilder { public static class Concrete extends ClassBuilder { private final ClassVisitor v; - private final boolean stubs; - public Concrete(ClassVisitor v, boolean stubs) { + public Concrete(ClassVisitor v) { this.v = v; - this.stubs = stubs; } @Override public ClassVisitor getVisitor() { return v; } - - @Override - public Mode generateCode() { - return stubs ? Mode.STUBS : Mode.FULL; - } } public FieldVisitor newField(@Nullable PsiElement origin, int access, @@ -88,15 +85,4 @@ public abstract class ClassBuilder { public void visitInnerClass(String name, String outerName, String innerName, int access) { getVisitor().visitInnerClass(name, outerName, innerName, access); } - - public enum Mode { - /** Full function bodies */ - FULL, - /** Only function signatures */ - SIGNATURES, - /** Function with stub bodies: just throw exception */ - STUBS, - } - - public abstract Mode generateCode(); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactories.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactories.java index 06604f797ba..485c049037b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactories.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactories.java @@ -16,6 +16,7 @@ package org.jetbrains.jet.codegen; +import org.jetbrains.annotations.NotNull; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.util.TraceClassVisitor; @@ -28,9 +29,15 @@ import java.io.StringWriter; public class ClassBuilderFactories { public static ClassBuilderFactory TEXT = new ClassBuilderFactory() { + @NotNull + @Override + public ClassBuilderMode getClassBuilderMode() { + return ClassBuilderMode.FULL; + } + @Override public ClassBuilder newClassBuilder() { - return new ClassBuilder.Concrete(new TraceClassVisitor(new PrintWriter(new StringWriter())), false); + return new ClassBuilder.Concrete(new TraceClassVisitor(new PrintWriter(new StringWriter()))); } @Override @@ -51,6 +58,12 @@ public class ClassBuilderFactories { public static ClassBuilderFactory binaries(final boolean stubs) { return new ClassBuilderFactory() { + @NotNull + @Override + public ClassBuilderMode getClassBuilderMode() { + return stubs ? ClassBuilderMode.STUBS : ClassBuilderMode.FULL; + } + @Override public ClassBuilder newClassBuilder() { return new ClassBuilder.Concrete(new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS){ @@ -64,7 +77,7 @@ public class ClassBuilderFactories { return "java/lang/Object"; } } - }, stubs); + }); } @Override diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactory.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactory.java index e46d50c4fe2..9806778934b 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactory.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderFactory.java @@ -16,6 +16,7 @@ package org.jetbrains.jet.codegen; +import org.jetbrains.annotations.NotNull; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.util.TraceClassVisitor; @@ -26,6 +27,8 @@ import java.io.StringWriter; * @author max */ public interface ClassBuilderFactory { + @NotNull + ClassBuilderMode getClassBuilderMode(); ClassBuilder newClassBuilder(); String asText(ClassBuilder builder); byte[] asBytes(ClassBuilder builder); diff --git a/confluence/src/main/java/com/intellij/lexer/Foo.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderMode.java similarity index 70% rename from confluence/src/main/java/com/intellij/lexer/Foo.java rename to compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderMode.java index afacc1e12c5..096391c2be8 100644 --- a/confluence/src/main/java/com/intellij/lexer/Foo.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassBuilderMode.java @@ -14,10 +14,16 @@ * limitations under the License. */ -package com.intellij.lexer; +package org.jetbrains.jet.codegen; /** - * @author abreslav - */ -public class Foo { +* @author Stepan Koltsov +*/ +public enum ClassBuilderMode { + /** Full function bodies */ + FULL, + /** Only function signatures */ + SIGNATURES, + /** Function with stub bodies: just throw exception */ + STUBS, } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassCodegen.java index f596669dff8..a585ef6b737 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassCodegen.java @@ -40,7 +40,7 @@ public class ClassCodegen { final CodegenContext contextForInners = context.intoClass(descriptor, OwnerKind.IMPLEMENTATION, state.getInjector().getJetTypeMapper()); - if (classBuilder.generateCode() == ClassBuilder.Mode.SIGNATURES) { + if (state.getClassBuilderMode() == ClassBuilderMode.SIGNATURES) { // Outer class implementation must happen prior inner classes so we get proper scoping tree in JetLightClass's delegate generateImplementation(context, aClass, OwnerKind.IMPLEMENTATION, contextForInners.accessors, classBuilder); } @@ -54,7 +54,7 @@ public class ClassCodegen { } } - if (classBuilder.generateCode() != ClassBuilder.Mode.SIGNATURES) { + if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES) { generateImplementation(context, aClass, OwnerKind.IMPLEMENTATION, contextForInners.accessors, classBuilder); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java index 8f4c2bdd3f3..46fa697d5cb 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java @@ -170,10 +170,10 @@ public class ClosureCodegen extends ObjectOrClosureCodegen { cv.newField(fun, ACC_PRIVATE | ACC_STATIC | ACC_FINAL, "$instance", classDescr, null, null); MethodVisitor mv = cv.newMethod(fun, ACC_PUBLIC | ACC_STATIC, "$getInstance", "()" + classDescr, null, new String[0]); - if (cv.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (cv.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); mv.visitFieldInsn(GETSTATIC, name, "$instance", classDescr); mv.visitInsn(DUP); @@ -211,10 +211,10 @@ public class ClosureCodegen extends ObjectOrClosureCodegen { return; final MethodVisitor mv = cv.newMethod(fun, ACC_PUBLIC, "invoke", bridge.getAsmMethod().getDescriptor(), null, new String[0]); - if (cv.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - if (cv.generateCode() == ClassBuilder.Mode.FULL) { + if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); @@ -296,10 +296,10 @@ public class ClosureCodegen extends ObjectOrClosureCodegen { final Method constructor = new Method("", Type.VOID_TYPE, argTypes); final MethodVisitor mv = cv.newMethod(fun, ACC_PUBLIC, "", constructor.getDescriptor(), null, new String[0]); - if (cv.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (cv.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java index 7238ed6bbb3..0a828995516 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java @@ -124,7 +124,7 @@ public class FunctionCodegen { final MethodVisitor mv = v.newMethod(fun, flags, jvmSignature.getAsmMethod().getName(), jvmSignature.getAsmMethod().getDescriptor(), jvmSignature.getGenericsSignature(), null); AnnotationCodegen.forMethod(mv, state.getInjector().getJetTypeMapper()).genAnnotations(functionDescriptor); - if(v.generateCode() != ClassBuilder.Mode.SIGNATURES) { + if(state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES) { int start = 0; if (needJetAnnotations) { if (functionDescriptor instanceof PropertyAccessorDescriptor) { @@ -169,12 +169,12 @@ public class FunctionCodegen { } } - if (!isAbstract && v.generateCode() == ClassBuilder.Mode.STUBS) { + if (!isAbstract && state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - if (!isAbstract && v.generateCode() == ClassBuilder.Mode.FULL) { + if (!isAbstract && state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); Label methodBegin = new Label(); @@ -345,10 +345,10 @@ public class FunctionCodegen { descriptor = descriptor.replace("(","(L" + ownerInternalName + ";"); final MethodVisitor mv = v.newMethod(null, flags | (isConstructor ? 0 : ACC_STATIC), isConstructor ? "" : jvmSignature.getName() + JvmAbi.DEFAULT_PARAMS_IMPL_SUFFIX, descriptor, null, null); InstructionAdapter iv = new InstructionAdapter(mv); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); FrameMap frameMap = owner.prepareFrame(state.getInjector().getJetTypeMapper()); @@ -474,10 +474,10 @@ public class FunctionCodegen { int flags = ACC_PUBLIC | ACC_BRIDGE; // TODO. final MethodVisitor mv = v.newMethod(null, flags, jvmSignature.getName(), overriden.getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); Type[] argTypes = overriden.getArgumentTypes(); @@ -515,10 +515,10 @@ public class FunctionCodegen { int flags = ACC_PUBLIC | ACC_SYNTHETIC; // TODO. final MethodVisitor mv = v.newMethod(null, flags, method.getName(), method.getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); Type[] argTypes = method.getArgumentTypes(); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java b/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java index fd583a67fee..33bb005af93 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java @@ -49,6 +49,8 @@ public class GenerationState { private final List files; @NotNull private final InjectorForJvmCodegen injector; + @NotNull + private final ClassBuilderMode classBuilderMode; public GenerationState(Project project, ClassBuilderFactory builderFactory, AnalyzeExhaust analyzeExhaust, List files) { @@ -61,9 +63,10 @@ public class GenerationState { this.progress = progress; this.analyzeExhaust = exhaust; this.files = files; + this.classBuilderMode = builderFactory.getClassBuilderMode(); this.injector = new InjectorForJvmCodegen( analyzeExhaust.getStandardLibrary(), analyzeExhaust.getBindingContext(), - this.files, project, compilerSpecialMode, this, builderFactory); + this.files, project, compilerSpecialMode, builderFactory.getClassBuilderMode(), this, builderFactory); } @NotNull @@ -83,6 +86,11 @@ public class GenerationState { return analyzeExhaust.getBindingContext(); } + @NotNull + public ClassBuilderMode getClassBuilderMode() { + return classBuilderMode; + } + public ClassCodegen forClass() { return new ClassCodegen(this); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java index 71719b9a217..7a7b2cd023d 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java @@ -296,10 +296,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { Type[] argTypes = method.getArgumentTypes(); MethodVisitor mv = v.newMethod(null, ACC_PUBLIC| ACC_BRIDGE| ACC_FINAL, bridge.getName(), method.getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); @@ -327,10 +327,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { Method originalMethod = originalSignature.getJvmMethodSignature().getAsmMethod(); MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | ACC_BRIDGE | ACC_FINAL, method.getName(), method.getDescriptor(), null, null); PropertyCodegen.generateJetPropertyAnnotation(mv, originalSignature.getPropertyTypeKotlinSignature(), originalSignature.getJvmMethodSignature().getKotlinTypeParameter()); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); @@ -353,10 +353,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { Method originalMethod = originalSignature2.getJvmMethodSignature().getAsmMethod(); MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | ACC_BRIDGE | ACC_FINAL, method.getName(), method.getDescriptor(), null, null); PropertyCodegen.generateJetPropertyAnnotation(mv, originalSignature2.getPropertyTypeKotlinSignature(), originalSignature2.getJvmMethodSignature().getKotlinTypeParameter()); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); InstructionAdapter iv = new InstructionAdapter(mv); @@ -531,7 +531,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { int flags = ACC_PUBLIC; // TODO final MethodVisitor mv = v.newMethod(myClass, flags, constructorMethod.getName(), constructorMethod.getAsmMethod().getDescriptor(), constructorMethod.getGenericsSignature(), null); - if (v.generateCode() == ClassBuilder.Mode.SIGNATURES) return; + if (state.getClassBuilderMode() == ClassBuilderMode.SIGNATURES) return; AnnotationVisitor jetConstructorVisitor = mv.visitAnnotation(JvmStdlibNames.JET_CONSTRUCTOR.getDescriptor(), true); if (constructorDescriptor == null) { @@ -558,7 +558,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { } } - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); return; } @@ -733,10 +733,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { Method functionOriginal = typeMapper.mapSignature(fun.getName(), fun.getOriginal()).getAsmMethod(); final MethodVisitor mv = v.newMethod(myClass, flags, function.getName(), function.getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); codegen.generateThisOrOuter(descriptor); @@ -872,10 +872,10 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { CallableMethod method = typeMapper.mapToCallableMethod(constructorDescriptor, kind, typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration())); int flags = ACC_PUBLIC; // TODO final MethodVisitor mv = v.newMethod(constructor, flags, "", method.getSignature().getAsmMethod().getDescriptor(), null, null); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubCode(mv); } - else if (v.generateCode() == ClassBuilder.Mode.FULL) { + else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); ConstructorFrameMap frameMap = new ConstructorFrameMap(method, constructorDescriptor, typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration())); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java index 3508bb9eb03..c19b4e25aa9 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java @@ -65,6 +65,7 @@ public class JetTypeMapper { public BindingContext bindingContext; private ClosureAnnotator closureAnnotator; private CompilerSpecialMode compilerSpecialMode; + private ClassBuilderMode classBuilderMode; @Inject @@ -87,6 +88,11 @@ public class JetTypeMapper { this.compilerSpecialMode = compilerSpecialMode; } + @Inject + public void setClassBuilderMode(ClassBuilderMode classBuilderMode) { + this.classBuilderMode = classBuilderMode; + } + @PostConstruct public void init() { initKnownTypes(); @@ -335,6 +341,9 @@ public class JetTypeMapper { DeclarationDescriptor descriptor = jetType.getConstructor().getDeclarationDescriptor(); if (ErrorUtils.isError(descriptor)) { + if (classBuilderMode != ClassBuilderMode.SIGNATURES) { + throw new IllegalStateException("error types are not allowed when classBuilderMode = " + classBuilderMode); + } Type asmType = Type.getObjectType("error/NonExistentClass"); if (signatureVisitor != null) { visitAsmType(signatureVisitor, asmType, true); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java index ca2fe73e250..2a3338c7510 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/NamespaceCodegen.java @@ -92,7 +92,7 @@ public class NamespaceCodegen { private void generateStaticInitializers(JetFile namespace) { MethodVisitor mv = v.newMethod(namespace, ACC_PUBLIC | ACC_STATIC, "", "()V", null, null); - if (v.generateCode() == ClassBuilder.Mode.FULL) { + if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { mv.visitCode(); FrameMap frameMap = new FrameMap(); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java index f8070e10c35..d9d4e9f9373 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java @@ -182,10 +182,10 @@ public class PropertyCodegen { AnnotationCodegen.forMethod(mv, state.getInjector().getJetTypeMapper()).genAnnotations(propertyDescriptor.getGetter()); } - if (v.generateCode() != ClassBuilder.Mode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) { + if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) { if(propertyDescriptor.getModality() != Modality.ABSTRACT) { mv.visitCode(); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubThrow(mv); } else { @@ -266,10 +266,10 @@ public class PropertyCodegen { AnnotationCodegen.forMethod(mv, state.getInjector().getJetTypeMapper()).genAnnotations(propertyDescriptor.getSetter()); } - if (v.generateCode() != ClassBuilder.Mode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) { + if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES && (!isTrait || kind instanceof OwnerKind.DelegateKind)) { if(propertyDescriptor.getModality() != Modality.ABSTRACT) { mv.visitCode(); - if (v.generateCode() == ClassBuilder.Mode.STUBS) { + if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { StubCodegen.generateStubThrow(mv); } else { diff --git a/compiler/backend/src/org/jetbrains/jet/di/InjectorForJetTypeMapper.java b/compiler/backend/src/org/jetbrains/jet/di/InjectorForJetTypeMapper.java index ddbaad7230d..30a4db600be 100644 --- a/compiler/backend/src/org/jetbrains/jet/di/InjectorForJetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/jet/di/InjectorForJetTypeMapper.java @@ -23,6 +23,7 @@ import java.util.List; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.codegen.JetTypeMapper; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.ClosureAnnotator; import org.jetbrains.jet.lang.types.lang.JetStandardLibrary; import org.jetbrains.jet.lang.resolve.BindingContext; @@ -42,9 +43,11 @@ public class InjectorForJetTypeMapper { ) { this.jetTypeMapper = new JetTypeMapper(); CompilerSpecialMode compilerSpecialMode = CompilerSpecialMode.REGULAR; + ClassBuilderMode classBuilderMode = ClassBuilderMode.FULL; ClosureAnnotator closureAnnotator = new ClosureAnnotator(); this.jetTypeMapper.setBindingContext(bindingContext); + this.jetTypeMapper.setClassBuilderMode(classBuilderMode); this.jetTypeMapper.setClosureAnnotator(closureAnnotator); this.jetTypeMapper.setCompilerSpecialMode(compilerSpecialMode); this.jetTypeMapper.setStandardLibrary(jetStandardLibrary); diff --git a/compiler/backend/src/org/jetbrains/jet/di/InjectorForJvmCodegen.java b/compiler/backend/src/org/jetbrains/jet/di/InjectorForJvmCodegen.java index 626c27bbf54..e54bef57e52 100644 --- a/compiler/backend/src/org/jetbrains/jet/di/InjectorForJvmCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/di/InjectorForJvmCodegen.java @@ -23,6 +23,7 @@ import java.util.List; import org.jetbrains.jet.lang.psi.JetFile; import com.intellij.openapi.project.Project; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.GenerationState; import org.jetbrains.jet.codegen.ClassBuilderFactory; import org.jetbrains.jet.codegen.JetTypeMapper; @@ -35,6 +36,7 @@ import java.util.List; import org.jetbrains.jet.lang.psi.JetFile; import com.intellij.openapi.project.Project; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.GenerationState; import org.jetbrains.jet.codegen.ClassBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -54,6 +56,7 @@ public class InjectorForJvmCodegen { @NotNull List listOfJetFile, @NotNull Project project, @NotNull CompilerSpecialMode compilerSpecialMode, + @NotNull ClassBuilderMode classBuilderMode, @NotNull GenerationState generationState, @NotNull ClassBuilderFactory classBuilderFactory ) { @@ -65,6 +68,7 @@ public class InjectorForJvmCodegen { ClosureAnnotator closureAnnotator = new ClosureAnnotator(); this.jetTypeMapper.setBindingContext(bindingContext); + this.jetTypeMapper.setClassBuilderMode(classBuilderMode); this.jetTypeMapper.setClosureAnnotator(closureAnnotator); this.jetTypeMapper.setCompilerSpecialMode(compilerSpecialMode); this.jetTypeMapper.setStandardLibrary(jetStandardLibrary); diff --git a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java index 8be718f846a..54a6eef6608 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java @@ -20,11 +20,11 @@ import com.google.common.base.Splitter; import com.google.common.collect.Iterables; import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Multimap; +import com.intellij.openapi.Disposable; +import com.intellij.openapi.util.Disposer; import com.sampullara.cli.Args; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.compiler.CompileEnvironment; -import org.jetbrains.jet.compiler.CompileEnvironmentException; -import org.jetbrains.jet.compiler.CompilerPlugin; +import org.jetbrains.jet.compiler.*; import org.jetbrains.jet.compiler.messages.CompilerMessageLocation; import org.jetbrains.jet.compiler.messages.CompilerMessageSeverity; import org.jetbrains.jet.compiler.messages.MessageCollector; @@ -135,23 +135,30 @@ public class KotlinCompiler { runtimeJar = null; } - CompilerDependencies dependencies = new CompilerDependencies(mode, jdkHeadersJar,runtimeJar); + CompilerDependencies dependencies = new CompilerDependencies(mode, jdkHeadersJar, runtimeJar); PrintingMessageCollector messageCollector = new PrintingMessageCollector(errStream, messageRenderer, arguments.verbose); - CompileEnvironment environment = new CompileEnvironment(messageCollector, dependencies); + Disposable rootDisposable = CompileEnvironmentUtil.createMockDisposable(); + + JetCoreEnvironment environment = new JetCoreEnvironment(rootDisposable, dependencies); + CompileEnvironmentConfiguration configuration = new CompileEnvironmentConfiguration(environment, dependencies, messageCollector); try { - configureEnvironment(environment, arguments); + configureEnvironment(configuration, arguments); boolean noErrors; if (arguments.module != null) { - noErrors = environment.compileModuleScript(arguments.module, arguments.jar, arguments.outputDir, arguments.includeRuntime); + noErrors = KotlinToJVMBytecodeCompiler.compileModuleScript(configuration, + arguments.module, arguments.jar, arguments.outputDir, + arguments.includeRuntime); } else { // TODO ideally we'd unify to just having a single field that supports multiple files/dirs if (arguments.getSourceDirs() != null) { - noErrors = environment.compileBunchOfSourceDirectories(arguments.getSourceDirs(), arguments.jar, arguments.outputDir, arguments.includeRuntime); + noErrors = KotlinToJVMBytecodeCompiler.compileBunchOfSourceDirectories(configuration, + arguments.getSourceDirs(), arguments.jar, arguments.outputDir, arguments.includeRuntime); } else { - noErrors = environment.compileBunchOfSources(arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime); + noErrors = KotlinToJVMBytecodeCompiler.compileBunchOfSources(configuration, + arguments.src, arguments.jar, arguments.outputDir, arguments.includeRuntime); } } return noErrors ? OK : COMPILATION_ERROR; @@ -161,7 +168,7 @@ public class KotlinCompiler { return INTERNAL_ERROR; } finally { - environment.dispose(); + Disposer.dispose(rootDisposable); messageCollector.printToErrStream(); } } @@ -228,20 +235,20 @@ public class KotlinCompiler { * Strategy method to configure the environment, allowing compiler * based tools to customise their own plugins */ - protected void configureEnvironment(CompileEnvironment environment, CompilerArguments arguments) { + protected void configureEnvironment(CompileEnvironmentConfiguration configuration, CompilerArguments arguments) { // install any compiler plugins List plugins = arguments.getCompilerPlugins(); if (plugins != null) { - environment.getEnvironment().getCompilerPlugins().addAll(plugins); + configuration.getCompilerPlugins().addAll(plugins); } - if (environment.getCompilerDependencies().getRuntimeJar() != null) { - environment.addToClasspath(environment.getCompilerDependencies().getRuntimeJar()); + if (configuration.getCompilerDependencies().getRuntimeJar() != null) { + CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), configuration.getCompilerDependencies().getRuntimeJar()); } if (arguments.classpath != null) { final Iterable classpath = Splitter.on(File.pathSeparatorChar).split(arguments.classpath); - environment.addToClasspath(Iterables.toArray(classpath, String.class)); + CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), Iterables.toArray(classpath, String.class)); } } diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java deleted file mode 100644 index ac22091f949..00000000000 --- a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.compiler; - -import com.intellij.openapi.Disposable; -import com.intellij.openapi.util.Disposer; -import com.intellij.testFramework.LightVirtualFile; -import com.intellij.util.LocalTimeCounter; -import jet.modules.Module; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.codegen.ClassFileFactory; -import org.jetbrains.jet.codegen.GeneratedClassLoader; -import org.jetbrains.jet.codegen.GenerationState; -import org.jetbrains.jet.compiler.messages.MessageCollector; -import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.psi.JetPsiUtil; -import org.jetbrains.jet.lang.resolve.FqName; -import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; -import org.jetbrains.jet.lang.resolve.java.JvmAbi; -import org.jetbrains.jet.plugin.JetLanguage; -import org.jetbrains.jet.plugin.JetMainDetector; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.util.List; - -/** - * The environment for compiling a bunch of source files or - * - * @author yole - */ -public class CompileEnvironment { - private final Disposable rootDisposable; - private JetCoreEnvironment environment; - - private final MessageCollector messageCollector; - - @NotNull - private final CompilerDependencies compilerDependencies; - - /** - * NOTE: It's very important to call dispose for every object of this class or there will be memory leaks. - * @see Disposer - */ - public CompileEnvironment(@NotNull MessageCollector messageCollector, @NotNull CompilerDependencies compilerDependencies) { - this.messageCollector = messageCollector; - this.compilerDependencies = compilerDependencies; - this.rootDisposable = new Disposable() { - @Override - public void dispose() { - } - }; - this.environment = new JetCoreEnvironment(rootDisposable, compilerDependencies); - } - - - public void dispose() { - Disposer.dispose(rootDisposable); - } - - public boolean compileModuleScript(String moduleScriptFile, @Nullable String jarPath, @Nullable String outputDir, boolean jarRuntime) { - List modules = CompileEnvironmentUtil.loadModuleScript(moduleScriptFile, messageCollector); - - if (modules == null) { - throw new CompileEnvironmentException("Module script " + moduleScriptFile + " compilation failed"); - } - - if (modules.isEmpty()) { - throw new CompileEnvironmentException("No modules where defined by " + moduleScriptFile); - } - - final String directory = new File(moduleScriptFile).getParent(); - for (Module moduleBuilder : modules) { - if (compilerDependencies.getRuntimeJar() != null) { - addToClasspath(compilerDependencies.getRuntimeJar()); - } - ClassFileFactory moduleFactory = compileModule(moduleBuilder, directory); - if (moduleFactory == null) { - return false; - } - if (outputDir != null) { - CompileEnvironmentUtil.writeToOutputDirectory(moduleFactory, outputDir); - } - else { - String path = jarPath != null ? jarPath : new File(directory, moduleBuilder.getModuleName() + ".jar").getPath(); - try { - CompileEnvironmentUtil.writeToJar(moduleFactory, new FileOutputStream(path), null, jarRuntime); - } - catch (FileNotFoundException e) { - throw new CompileEnvironmentException("Invalid jar path " + path, e); - } - } - } - return true; - } - - public ClassFileFactory compileModule(Module moduleBuilder, String directory) { - if (moduleBuilder.getSourceFiles().isEmpty()) { - throw new CompileEnvironmentException("No source files where defined"); - } - - for (String sourceFile : moduleBuilder.getSourceFiles()) { - File source = new File(sourceFile); - if (!source.isAbsolute()) { - source = new File(directory, sourceFile); - } - - if (!source.exists()) { - throw new CompileEnvironmentException("'" + source + "' does not exist"); - } - - environment.addSources(source.getPath()); - } - for (String classpathRoot : moduleBuilder.getClasspathRoots()) { - environment.addToClasspath(new File(classpathRoot)); - } - - CompileEnvironmentUtil.ensureRuntime(environment, compilerDependencies); - - return analyze(); - } - - public ClassLoader compileText(String code) { - environment.addSources(new LightVirtualFile("script" + LocalTimeCounter.currentTime() + ".kt", JetLanguage.INSTANCE, code)); - - ClassFileFactory factory = analyze(); - if (factory == null) { - return null; - } - return new GeneratedClassLoader(factory); - } - - public boolean compileBunchOfSources(String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime) { - environment.addSources(sourceFileOrDir); - - return compileBunchOfSources(jar, outputDir, includeRuntime); - } - - public boolean compileBunchOfSourceDirectories(List sources, String jar, String outputDir, boolean includeRuntime) { - for (String source : sources) { - environment.addSources(source); - } - - return compileBunchOfSources(jar, outputDir, includeRuntime); - } - - private boolean compileBunchOfSources(String jar, String outputDir, boolean includeRuntime) { - FqName mainClass = null; - for (JetFile file : environment.getSourceFiles()) { - if (JetMainDetector.hasMain(file.getDeclarations())) { - FqName fqName = JetPsiUtil.getFQName(file); - mainClass = fqName.child(JvmAbi.PACKAGE_CLASS); - break; - } - } - - CompileEnvironmentUtil.ensureRuntime(environment, compilerDependencies); - - ClassFileFactory factory = analyze(); - if (factory == null) { - return false; - } - - if (jar != null) { - try { - CompileEnvironmentUtil.writeToJar(factory, new FileOutputStream(jar), mainClass, includeRuntime); - } catch (FileNotFoundException e) { - throw new CompileEnvironmentException("Invalid jar path " + jar, e); - } - } - else if (outputDir != null) { - CompileEnvironmentUtil.writeToOutputDirectory(factory, outputDir); - } - else { - throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk"); - } - return true; - } - - private ClassFileFactory analyze() { - boolean stubs = compilerDependencies.getCompilerSpecialMode().isStubs(); - GenerationState generationState = - KotlinToJVMBytecodeCompiler - .analyzeAndGenerate(environment, compilerDependencies, messageCollector, stubs); - if (generationState == null) { - return null; - } - return generationState.getFactory(); - } - - /** - * Add path specified to the compilation environment. - * @param paths paths to add - */ - public void addToClasspath(File ... paths) { - for (File path : paths) { - if (!path.exists()) { - throw new CompileEnvironmentException("'" + path + "' does not exist"); - } - environment.addToClasspath(path); - } - } - - /** - * Add path specified to the compilation environment. - * @param paths paths to add - */ - public void addToClasspath(String ... paths) { - for (String path : paths) { - addToClasspath( new File(path)); - } - } - - public void setStdlib(String stdlib) { - File file = new File(stdlib); - addToClasspath(file); - } - - public JetCoreEnvironment getEnvironment() { - return environment; - } - - @NotNull - public CompilerDependencies getCompilerDependencies() { - return compilerDependencies; - } -} diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java new file mode 100644 index 00000000000..cf57bee50b2 --- /dev/null +++ b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentConfiguration.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.compiler; + +import com.google.common.collect.Lists; +import com.intellij.openapi.util.Disposer; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.compiler.messages.MessageCollector; +import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; + +import java.util.List; + +/** + * @author abreslav + */ +public class CompileEnvironmentConfiguration { + private final JetCoreEnvironment environment; + private final CompilerDependencies compilerDependencies; + private final MessageCollector messageCollector; + + private List compilerPlugins = Lists.newArrayList(); + + /** + * NOTE: It's very important to call dispose for every object of this class or there will be memory leaks. + * @see Disposer + */ + public CompileEnvironmentConfiguration(@NotNull JetCoreEnvironment environment, + @NotNull CompilerDependencies compilerDependencies, @NotNull MessageCollector messageCollector) { + this.messageCollector = messageCollector; + this.compilerDependencies = compilerDependencies; + this.environment = environment; + } + + public JetCoreEnvironment getEnvironment() { + return environment; + } + + @NotNull + public CompilerDependencies getCompilerDependencies() { + return compilerDependencies; + } + + @NotNull + public MessageCollector getMessageCollector() { + return messageCollector; + } + + public List getCompilerPlugins() { + return compilerPlugins; + } +} diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java index eaf0af30966..ca803c0549f 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironmentUtil.java @@ -51,9 +51,17 @@ import java.util.jar.*; * @author abreslav */ public class CompileEnvironmentUtil { + public static Disposable createMockDisposable() { + return new Disposable() { + @Override + public void dispose() { + } + }; + } + @Nullable public static File getUnpackedRuntimePath() { - URL url = CompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class"); + URL url = CompileEnvironmentConfiguration.class.getClassLoader().getResource("jet/JetObject.class"); if (url != null && url.getProtocol().equals("file")) { return new File(url.getPath()).getParentFile().getParentFile(); } @@ -62,7 +70,7 @@ public class CompileEnvironmentUtil { @Nullable public static File getRuntimeJarPath() { - URL url = CompileEnvironment.class.getClassLoader().getResource("jet/JetObject.class"); + URL url = CompileEnvironmentConfiguration.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("!/"))); @@ -165,7 +173,7 @@ public class CompileEnvironmentUtil { scriptEnvironment.addSources(moduleFile); GenerationState generationState = KotlinToJVMBytecodeCompiler - .analyzeAndGenerate(scriptEnvironment, dependencies, messageCollector, false); + .analyzeAndGenerate(new CompileEnvironmentConfiguration(scriptEnvironment, dependencies, messageCollector), false); if (generationState == null) { return null; } @@ -187,7 +195,7 @@ public class CompileEnvironmentUtil { } } else { - loader = new GeneratedClassLoader(factory, CompileEnvironment.class.getClassLoader()); + loader = new GeneratedClassLoader(factory, CompileEnvironmentConfiguration.class.getClassLoader()); } try { Class namespaceClass = loader.loadClass(JvmAbi.PACKAGE_CLASS); @@ -301,4 +309,29 @@ public class CompileEnvironmentUtil { } } } + + /** + * Add path specified to the compilation environment. + * @param environment compilation environment to add to + * @param paths paths to add + */ + public static void addToClasspath(JetCoreEnvironment environment, File ... paths) { + for (File path : paths) { + if (!path.exists()) { + throw new CompileEnvironmentException("'" + path + "' does not exist"); + } + environment.addToClasspath(path); + } + } + + /** + * Add path specified to the compilation environment. + * @param environment compilation environment to add to + * @param paths paths to add + */ + public static void addToClasspath(JetCoreEnvironment environment, String ... paths) { + for (String path : paths) { + addToClasspath(environment, new File(path)); + } + } } diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/JetCoreEnvironment.java b/compiler/cli/src/org/jetbrains/jet/compiler/JetCoreEnvironment.java index c3f24f3179e..bd8eb357ccf 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/JetCoreEnvironment.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/JetCoreEnvironment.java @@ -46,7 +46,6 @@ import java.util.List; */ public class JetCoreEnvironment extends JavaCoreEnvironment { private final List sourceFiles = new ArrayList(); - private List compilerPlugins = new ArrayList(); public JetCoreEnvironment(Disposable parentDisposable, @NotNull CompilerDependencies compilerDependencies) { super(parentDisposable); @@ -138,14 +137,6 @@ public class JetCoreEnvironment extends JavaCoreEnvironment { return sourceFiles; } - public List getCompilerPlugins() { - return compilerPlugins; - } - - public void setCompilerPlugins(List compilerPlugins) { - this.compilerPlugins = compilerPlugins; - } - public void addToClasspathFromClassLoader(ClassLoader loader) { ClassLoader parent = loader.getParent(); if(parent != null) diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java b/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java index ecc239820ad..7e6af64de21 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/KotlinToJVMBytecodeCompiler.java @@ -25,12 +25,13 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiErrorElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiRecursiveElementWalkingVisitor; +import com.intellij.testFramework.LightVirtualFile; +import com.intellij.util.LocalTimeCounter; +import jet.modules.Module; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.analyzer.AnalyzeExhaust; -import org.jetbrains.jet.codegen.ClassBuilderFactories; -import org.jetbrains.jet.codegen.CompilationErrorHandler; -import org.jetbrains.jet.codegen.GenerationState; +import org.jetbrains.jet.codegen.*; import org.jetbrains.jet.compiler.messages.CompilerMessageLocation; import org.jetbrains.jet.compiler.messages.CompilerMessageSeverity; import org.jetbrains.jet.compiler.messages.MessageCollector; @@ -41,12 +42,19 @@ import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory; import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils; import org.jetbrains.jet.lang.diagnostics.Severity; import org.jetbrains.jet.lang.psi.JetFile; +import org.jetbrains.jet.lang.psi.JetPsiUtil; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.DescriptorUtils; +import org.jetbrains.jet.lang.resolve.FqName; import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM; -import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; +import org.jetbrains.jet.lang.resolve.java.JvmAbi; +import org.jetbrains.jet.plugin.JetLanguage; +import org.jetbrains.jet.plugin.JetMainDetector; import org.jetbrains.jet.utils.Progress; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.util.Collection; import java.util.List; @@ -57,15 +65,169 @@ import java.util.List; public class KotlinToJVMBytecodeCompiler { @Nullable - public static GenerationState analyzeAndGenerate( - JetCoreEnvironment environment, - CompilerDependencies dependencies, + public static ClassFileFactory compileModule( + CompileEnvironmentConfiguration configuration, + Module moduleBuilder, + String directory + ) { + if (moduleBuilder.getSourceFiles().isEmpty()) { + throw new CompileEnvironmentException("No source files where defined"); + } - final MessageCollector messageCollector, + for (String sourceFile : moduleBuilder.getSourceFiles()) { + File source = new File(sourceFile); + if (!source.isAbsolute()) { + source = new File(directory, sourceFile); + } + + if (!source.exists()) { + throw new CompileEnvironmentException("'" + source + "' does not exist"); + } + + configuration.getEnvironment().addSources(source.getPath()); + } + for (String classpathRoot : moduleBuilder.getClasspathRoots()) { + configuration.getEnvironment().addToClasspath(new File(classpathRoot)); + } + + CompileEnvironmentUtil.ensureRuntime(configuration.getEnvironment(), configuration.getCompilerDependencies()); + + GenerationState generationState = analyzeAndGenerate(configuration); + if (generationState == null) { + return null; + } + return generationState.getFactory(); + } + + public static boolean compileModuleScript( + CompileEnvironmentConfiguration configuration, + + @NotNull String moduleScriptFile, + @Nullable String jarPath, + @Nullable String outputDir, + boolean jarRuntime) { + List modules = CompileEnvironmentUtil.loadModuleScript(moduleScriptFile, configuration.getMessageCollector()); + + if (modules == null) { + throw new CompileEnvironmentException("Module script " + moduleScriptFile + " compilation failed"); + } + + if (modules.isEmpty()) { + throw new CompileEnvironmentException("No modules where defined by " + moduleScriptFile); + } + + final String directory = new File(moduleScriptFile).getParent(); + for (Module moduleBuilder : modules) { + // TODO: this should be done only once for the environment + if (configuration.getCompilerDependencies().getRuntimeJar() != null) { + CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), configuration.getCompilerDependencies().getRuntimeJar()); + } + ClassFileFactory moduleFactory = KotlinToJVMBytecodeCompiler.compileModule(configuration, moduleBuilder, directory); + if (moduleFactory == null) { + return false; + } + if (outputDir != null) { + CompileEnvironmentUtil.writeToOutputDirectory(moduleFactory, outputDir); + } + else { + String path = jarPath != null ? jarPath : new File(directory, moduleBuilder.getModuleName() + ".jar").getPath(); + try { + CompileEnvironmentUtil.writeToJar(moduleFactory, new FileOutputStream(path), null, jarRuntime); + } + catch (FileNotFoundException e) { + throw new CompileEnvironmentException("Invalid jar path " + path, e); + } + } + } + return true; + } + + private static boolean compileBunchOfSources( + CompileEnvironmentConfiguration configuration, + + String jar, + String outputDir, + boolean includeRuntime + ) { + FqName mainClass = null; + for (JetFile file : configuration.getEnvironment().getSourceFiles()) { + if (JetMainDetector.hasMain(file.getDeclarations())) { + FqName fqName = JetPsiUtil.getFQName(file); + mainClass = fqName.child(JvmAbi.PACKAGE_CLASS); + break; + } + } + + CompileEnvironmentUtil.ensureRuntime(configuration.getEnvironment(), configuration.getCompilerDependencies()); + + GenerationState generationState = analyzeAndGenerate(configuration); + if (generationState == null) { + return false; + } + + ClassFileFactory factory = generationState.getFactory(); + if (jar != null) { + try { + CompileEnvironmentUtil.writeToJar(factory, new FileOutputStream(jar), mainClass, includeRuntime); + } catch (FileNotFoundException e) { + throw new CompileEnvironmentException("Invalid jar path " + jar, e); + } + } + else if (outputDir != null) { + CompileEnvironmentUtil.writeToOutputDirectory(factory, outputDir); + } + else { + throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk"); + } + return true; + } + + public static boolean compileBunchOfSources( + CompileEnvironmentConfiguration configuration, + + String sourceFileOrDir, String jar, String outputDir, boolean includeRuntime) { + configuration.getEnvironment().addSources(sourceFileOrDir); + + return compileBunchOfSources(configuration, jar, outputDir, includeRuntime); + } + + public static boolean compileBunchOfSourceDirectories( + CompileEnvironmentConfiguration configuration, + + List sources, String jar, String outputDir, boolean includeRuntime) { + for (String source : sources) { + configuration.getEnvironment().addSources(source); + } + + return compileBunchOfSources(configuration, jar, outputDir, includeRuntime); + } + + @Nullable + public static ClassLoader compileText( + CompileEnvironmentConfiguration configuration, + + String code) { + configuration.getEnvironment().addSources(new LightVirtualFile("script" + LocalTimeCounter.currentTime() + ".kt", JetLanguage.INSTANCE, code)); + + GenerationState generationState = analyzeAndGenerate(configuration); + if (generationState == null) { + return null; + } + return new GeneratedClassLoader(generationState.getFactory()); + } + + @Nullable + public static GenerationState analyzeAndGenerate(CompileEnvironmentConfiguration configuration) { + return analyzeAndGenerate(configuration, configuration.getCompilerDependencies().getCompilerSpecialMode().isStubs()); + } + + @Nullable + public static GenerationState analyzeAndGenerate( + CompileEnvironmentConfiguration configuration, boolean stubs ) { - AnalyzeExhaust exhaust = analyze(environment, dependencies, messageCollector, stubs); + AnalyzeExhaust exhaust = analyze(configuration, stubs); if (exhaust == null) { return null; @@ -73,14 +235,13 @@ public class KotlinToJVMBytecodeCompiler { exhaust.throwIfError(); - return generate(environment, dependencies, messageCollector, exhaust, stubs); + return generate(configuration, exhaust, stubs); } @Nullable private static AnalyzeExhaust analyze( - JetCoreEnvironment environment, - CompilerDependencies dependencies, - final MessageCollector messageCollector, + final CompileEnvironmentConfiguration configuration, + boolean stubs) { final Ref hasErrors = new Ref(false); final MessageCollector messageCollectorWrapper = new MessageCollector() { @@ -92,10 +253,12 @@ public class KotlinToJVMBytecodeCompiler { if (CompilerMessageSeverity.ERRORS.contains(severity)) { hasErrors.set(true); } - messageCollector.report(severity, message, location); + configuration.getMessageCollector().report(severity, message, location); } }; + JetCoreEnvironment environment = configuration.getEnvironment(); + // Report syntax errors for (JetFile file : environment.getSourceFiles()) { file.accept(new PsiRecursiveElementWalkingVisitor() { @@ -114,7 +277,7 @@ public class KotlinToJVMBytecodeCompiler { stubs ? Predicates.alwaysFalse() : Predicates.alwaysTrue(); AnalyzeExhaust exhaust = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration( environment.getProject(), environment.getSourceFiles(), filesToAnalyzeCompletely, JetControlFlowDataTraceFactory.EMPTY, - dependencies); + configuration.getCompilerDependencies()); for (Diagnostic diagnostic : exhaust.getBindingContext().getDiagnostics()) { reportDiagnostic(messageCollectorWrapper, diagnostic); @@ -127,26 +290,24 @@ public class KotlinToJVMBytecodeCompiler { @NotNull private static GenerationState generate( - JetCoreEnvironment environment, - CompilerDependencies dependencies, - - final MessageCollector messageCollector, + final CompileEnvironmentConfiguration configuration, AnalyzeExhaust exhaust, boolean stubs) { + JetCoreEnvironment environment = configuration.getEnvironment(); Project project = environment.getProject(); Progress backendProgress = new Progress() { @Override public void log(String message) { - messageCollector.report(CompilerMessageSeverity.LOGGING, message, CompilerMessageLocation.NO_LOCATION); + configuration.getMessageCollector().report(CompilerMessageSeverity.LOGGING, message, CompilerMessageLocation.NO_LOCATION); } }; GenerationState generationState = new GenerationState(project, ClassBuilderFactories.binaries(stubs), backendProgress, - exhaust, environment.getSourceFiles(), dependencies.getCompilerSpecialMode()); + exhaust, environment.getSourceFiles(), configuration.getCompilerDependencies().getCompilerSpecialMode()); generationState.compileCorrectFiles(CompilationErrorHandler.THROW_EXCEPTION); - List plugins = environment.getCompilerPlugins(); + List plugins = configuration.getCompilerPlugins(); if (plugins != null) { CompilerPluginContext context = new CompilerPluginContext(project, exhaust.getBindingContext(), environment.getSourceFiles()); for (CompilerPlugin plugin : plugins) { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolutionContext.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolutionContext.java new file mode 100644 index 00000000000..03c5013330a --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolutionContext.java @@ -0,0 +1,40 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.resolve.calls; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.psi.Call; +import org.jetbrains.jet.lang.resolve.BindingTrace; + +/** +* @author svtk +*/ +public final class CallResolutionContext extends ResolutionContext { + /*package*/ final ResolvedCallImpl candidateCall; + /*package*/ final TracingStrategy tracing; + + public CallResolutionContext(@NotNull ResolvedCallImpl candidateCall, @NotNull ResolutionTask task, @NotNull BindingTrace trace, @NotNull TracingStrategy tracing, @NotNull Call call) { + super(trace, task.scope, call, task.expectedType, task.dataFlowInfo); + this.candidateCall = candidateCall; + this.tracing = tracing; + } + + public CallResolutionContext(@NotNull ResolvedCallImpl candidateCall, @NotNull ResolutionTask task, @NotNull BindingTrace trace, @NotNull TracingStrategy tracing) { + this(candidateCall, task, trace, tracing, task.call); + } +} diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java index 5b62fdadd2a..219f06d9156 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java @@ -102,16 +102,16 @@ public class CallResolver { if (referencedName == null) { return OverloadResolutionResultsImpl.nameNotFound(); } - TaskPrioritizer task_prioritizer; + List> memberPrioritizers = Lists.newArrayList(); if (nameExpression.getReferencedNameElementType() == JetTokens.FIELD_IDENTIFIER) { referencedName = referencedName.substring(1); - task_prioritizer = TaskPrioritizers.PROPERTY_TASK_PRIORITIZER; + memberPrioritizers.add(MemberPrioritizers.PROPERTY_TASK_PRIORITIZER); } else { - task_prioritizer = TaskPrioritizers.VARIABLE_TASK_PRIORITIZER; + memberPrioritizers.add(MemberPrioritizers.VARIABLE_TASK_PRIORITIZER); } - List> prioritizedTasks = task_prioritizer.computePrioritizedTasks(context, referencedName, nameExpression); - return doResolveCall(context, prioritizedTasks, nameExpression); + List> prioritizedTasks = TaskPrioritizer.computePrioritizedTasks(context, referencedName, nameExpression, memberPrioritizers); + return doResolveCall(context, prioritizedTasks, CallTransformationStrategy.PROPERTY_CALL_TRANSFORMATION_STRATEGY, nameExpression); } @NotNull @@ -119,9 +119,9 @@ public class CallResolver { @NotNull BasicResolutionContext context, @NotNull final JetReferenceExpression functionReference, @NotNull String name) { - List> tasks = TaskPrioritizers.FUNCTION_TASK_PRIORITIZER.computePrioritizedTasks( - context, name, functionReference); - return doResolveCall(context, tasks, functionReference); + List> tasks = TaskPrioritizer.computePrioritizedTasks( + context, name, functionReference, Collections.singletonList(MemberPrioritizers.FUNCTION_TASK_PRIORITIZER)); + return doResolveCall(context, tasks, CallTransformationStrategy.FUNCTION_CALL_TRANSFORMATION_STRATEGY, functionReference); } @NotNull @@ -142,7 +142,7 @@ public class CallResolver { String name = expression.getReferencedName(); if (name == null) return checkArgumentTypesAndFail(context); - prioritizedTasks = TaskPrioritizers.FUNCTION_TASK_PRIORITIZER.computePrioritizedTasks(context, name, functionReference); + prioritizedTasks = TaskPrioritizer.computePrioritizedTasks(context, name, functionReference, Collections.singletonList(MemberPrioritizers.FUNCTION_TASK_PRIORITIZER)); ResolutionTask.DescriptorCheckStrategy abstractConstructorCheck = new ResolutionTask.DescriptorCheckStrategy() { @Override public boolean performAdvancedChecks(D descriptor, BindingTrace trace, TracingStrategy tracing) { @@ -184,7 +184,7 @@ public class CallResolver { context.trace.report(NO_CONSTRUCTOR.on(reportAbsenceOn)); return checkArgumentTypesAndFail(context); } - Collection> candidates = TaskPrioritizer.convertWithImpliedThis(context.scope, Collections.singletonList(NO_RECEIVER), constructors); + Collection> candidates = TaskPrioritizer.convertWithImpliedThis(context.scope, Collections.singletonList(NO_RECEIVER), constructors); prioritizedTasks.add(new ResolutionTask(candidates, functionReference, context)); // !! DataFlowInfo.EMPTY } else { @@ -206,7 +206,7 @@ public class CallResolver { context.trace.report(NO_CONSTRUCTOR.on(reportAbsenceOn)); return checkArgumentTypesAndFail(context); } - List> candidates = ResolvedCallImpl.convertCollection(constructors); + List> candidates = ResolutionCandidate.convertCollection(constructors); prioritizedTasks = Collections.singletonList(new ResolutionTask(candidates, functionReference, context)); // !! DataFlowInfo.EMPTY } else if (calleeExpression != null) { @@ -223,15 +223,15 @@ public class CallResolver { FunctionDescriptorImpl functionDescriptor = new ExpressionAsFunctionDescriptor(context.scope.getContainingDeclaration(), "[for expression " + calleeExpression.getText() + "]"); FunctionDescriptorUtil.initializeFromFunctionType(functionDescriptor, calleeType, NO_RECEIVER); - ResolvedCallImpl resolvedCall = ResolvedCallImpl.create(functionDescriptor); - resolvedCall.setReceiverArgument(context.call.getExplicitReceiver()); + ResolutionCandidate resolutionCandidate = ResolutionCandidate.create(functionDescriptor); + resolutionCandidate.setReceiverArgument(context.call.getExplicitReceiver()); // strictly speaking, this is a hack: // we need to pass a reference, but there's no reference in the PSI, // so we wrap what we have into a fake reference and pass it on (unwrap on the other end) functionReference = new JetFakeReference(calleeExpression); - prioritizedTasks = Collections.singletonList(new ResolutionTask(Collections.singleton(resolvedCall), functionReference, context)); + prioritizedTasks = Collections.singletonList(new ResolutionTask(Collections.singleton(resolutionCandidate), functionReference, context)); } else { // checkTypesWithNoCallee(trace, scope, call); @@ -239,7 +239,7 @@ public class CallResolver { } } - return doResolveCall(context, prioritizedTasks, functionReference); + return doResolveCall(context, prioritizedTasks, CallTransformationStrategy.FUNCTION_CALL_TRANSFORMATION_STRATEGY, functionReference); } private OverloadResolutionResults checkArgumentTypesAndFail(BasicResolutionContext context) { @@ -251,6 +251,7 @@ public class CallResolver { private OverloadResolutionResults doResolveCall( @NotNull final BasicResolutionContext context, @NotNull final List> prioritizedTasks, // high to low priority + @NotNull CallTransformationStrategy callTransformationStrategy, @NotNull final JetReferenceExpression reference) { ResolutionDebugInfo.Data debugInfo = ResolutionDebugInfo.create(); @@ -267,7 +268,7 @@ public class CallResolver { OverloadResolutionResultsImpl resultsForFirstNonemptyCandidateSet = null; for (ResolutionTask task : prioritizedTasks) { TemporaryBindingTrace temporaryTrace = TemporaryBindingTrace.create(context.trace); - OverloadResolutionResultsImpl results = performResolutionGuardedForExtraFunctionLiteralArguments(task.withTrace(temporaryTrace)); + OverloadResolutionResultsImpl results = performResolutionGuardedForExtraFunctionLiteralArguments(task.withTrace(temporaryTrace), callTransformationStrategy); if (results.isSuccess() || results.isAmbiguity()) { temporaryTrace.commit(); @@ -299,8 +300,9 @@ public class CallResolver { ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @NotNull - private OverloadResolutionResultsImpl performResolutionGuardedForExtraFunctionLiteralArguments(ResolutionTask task) { - OverloadResolutionResultsImpl results = performResolution(task); + private OverloadResolutionResultsImpl performResolutionGuardedForExtraFunctionLiteralArguments(@NotNull ResolutionTask task, + @NotNull CallTransformationStrategy callTransformationStrategy) { + OverloadResolutionResultsImpl results = performResolution(task, callTransformationStrategy); // If resolution fails, we should check for some of the following situations: // class A { @@ -323,9 +325,9 @@ public class CallResolver { // We have some candidates that failed for some reason // And we have a suspect: the function literal argument // Now, we try to remove this argument and see if it helps - Collection> newCandidates = Lists.newArrayList(); - for (ResolvedCallImpl candidate : task.getCandidates()) { - newCandidates.add(ResolvedCallImpl.create(candidate.getCandidateDescriptor())); + Collection> newCandidates = Lists.newArrayList(); + for (ResolutionCandidate candidate : task.getCandidates()) { + newCandidates.add(ResolutionCandidate.create(candidate.getDescriptor())); } ResolutionTask newContext = new ResolutionTask(newCandidates, task.reference, TemporaryBindingTrace.create(task.trace), task.scope, new DelegatingCall(task.call) { @NotNull @@ -334,7 +336,7 @@ public class CallResolver { return Collections.emptyList(); } }, task.expectedType, task.dataFlowInfo); - OverloadResolutionResultsImpl resultsWithFunctionLiteralsStripped = performResolution(newContext); + OverloadResolutionResultsImpl resultsWithFunctionLiteralsStripped = performResolution(newContext, callTransformationStrategy); if (resultsWithFunctionLiteralsStripped.isSuccess() || resultsWithFunctionLiteralsStripped.isAmbiguity()) { task.tracing.danglingFunctionLiteralArgumentSuspected(task.trace, task.call.getFunctionLiteralArguments()); } @@ -344,101 +346,23 @@ public class CallResolver { } @NotNull - private OverloadResolutionResultsImpl performResolution(ResolutionTask task) { - for (ResolvedCallImpl candidateCall : task.getCandidates()) { - D candidate = candidateCall.getCandidateDescriptor(); + private OverloadResolutionResultsImpl performResolution(@NotNull ResolutionTask task, + @NotNull CallTransformationStrategy callTransformationStrategy) { + + for (ResolutionCandidate resolutionCandidate : task.getCandidates()) { TemporaryBindingTrace temporaryTrace = TemporaryBindingTrace.create(task.trace); - candidateCall.setTrace(temporaryTrace); + CallResolutionContext context = callTransformationStrategy.createCallContext(resolutionCandidate, task, temporaryTrace, task.tracing); + performResolutionForCandidateCall(context, task, temporaryTrace); - CallResolutionContext context = new CallResolutionContext(candidateCall, task, temporaryTrace, task.tracing); - - context.tracing.bindReference(context.trace, candidateCall); - - if (ErrorUtils.isError(candidate)) { - candidateCall.setStatus(SUCCESS); - checkTypesWithNoCallee(context.toBasic()); - continue; + Collection> calls = callTransformationStrategy.transformResultCall(context, this, task); + for (ResolvedCallImpl call : calls) { + task.getResolvedCallMap().put(resolutionCandidate, call); } - - if (!Visibilities.isVisible(candidate, context.scope.getContainingDeclaration())) { - candidateCall.setStatus(OTHER_ERROR); - context.tracing.invisibleMember(context.trace, candidate); - continue; - } - - boolean errorInArgumentMapping = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(context.call, context.tracing, candidateCall); - if (errorInArgumentMapping) { - candidateCall.setStatus(OTHER_ERROR); - checkTypesWithNoCallee(context.toBasic()); - continue; - } - - List jetTypeArguments = context.call.getTypeArguments(); - if (jetTypeArguments.isEmpty()) { - if (!candidate.getTypeParameters().isEmpty()) { - candidateCall.setStatus(inferTypeArguments(context)); - } - else { - candidateCall.setStatus(checkAllValueArguments(context)); - } - } - else { - // Explicit type arguments passed - - List typeArguments = new ArrayList(); - for (JetTypeProjection projection : jetTypeArguments) { - if (projection.getProjectionKind() != JetProjectionKind.NONE) { - context.trace.report(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT.on(projection)); - } - JetTypeReference typeReference = projection.getTypeReference(); - if (typeReference != null) { - typeArguments.add(typeResolver.resolveType(context.scope, typeReference, context.trace, true)); - } - else { - typeArguments.add(ErrorUtils.createErrorType("Star projection in a call")); - } - } - int expectedTypeArgumentCount = candidate.getTypeParameters().size(); - if (expectedTypeArgumentCount == jetTypeArguments.size()) { - - checkGenericBoundsInAFunctionCall(jetTypeArguments, typeArguments, candidate, context.trace); - - Map substitutionContext = FunctionDescriptorUtil.createSubstitutionContext((FunctionDescriptor) candidate, typeArguments); - D substitutedDescriptor = (D) candidate.substitute(TypeSubstitutor.create(substitutionContext)); - - candidateCall.setResultingDescriptor(substitutedDescriptor); - replaceValueParametersWithSubstitutedOnes(candidateCall, substitutedDescriptor); - - List typeParameters = candidateCall.getCandidateDescriptor().getTypeParameters(); - for (int i = 0; i < typeParameters.size(); i++) { - TypeParameterDescriptor typeParameterDescriptor = typeParameters.get(i); - candidateCall.recordTypeArgument(typeParameterDescriptor, typeArguments.get(i)); - } - candidateCall.setStatus(checkAllValueArguments(context)); - } - else { - candidateCall.setStatus(OTHER_ERROR); - context.tracing.wrongNumberOfTypeArguments(context.trace, expectedTypeArgumentCount); - } - } - - task.performAdvancedChecks(candidate, context.trace, context.tracing); - - // 'super' cannot be passed as an argument, for receiver arguments expression typer does not track this - // See TaskPrioritizer for more - JetSuperExpression superExpression = TaskPrioritizer.getReceiverSuper(candidateCall.getReceiverArgument()); - if (superExpression != null) { - context.trace.report(SUPER_IS_NOT_AN_EXPRESSION.on(superExpression, superExpression.getText())); - candidateCall.setStatus(OTHER_ERROR); - } - - recordAutoCastIfNecessary(candidateCall.getReceiverArgument(), candidateCall.getTrace()); - recordAutoCastIfNecessary(candidateCall.getThisObject(), candidateCall.getTrace()); } Set> successfulCandidates = Sets.newLinkedHashSet(); Set> failedCandidates = Sets.newLinkedHashSet(); - for (ResolvedCallImpl candidateCall : task.getCandidates()) { + for (ResolvedCallImpl candidateCall : task.getResolvedCallMap().values()) { ResolutionStatus status = candidateCall.getStatus(); if (status.isSuccess()) { successfulCandidates.add(candidateCall); @@ -456,6 +380,103 @@ public class CallResolver { return results; } + private void performResolutionForCandidateCall(@NotNull CallResolutionContext context, + @NotNull ResolutionTask task, + @NotNull TemporaryBindingTrace temporaryTrace) { + ResolvedCallImpl candidateCall = context.candidateCall; + + candidateCall.setTrace(temporaryTrace); + D candidate = candidateCall.getCandidateDescriptor(); + + context.tracing.bindReference(context.trace, candidateCall); + + if (ErrorUtils.isError(candidate)) { + candidateCall.addStatus(SUCCESS); + checkTypesWithNoCallee(context.toBasic()); + return; + } + + if (!Visibilities.isVisible(candidate, context.scope.getContainingDeclaration())) { + candidateCall.addStatus(OTHER_ERROR); + context.tracing.invisibleMember(context.trace, candidate); + return; + } + + ValueArgumentsToParametersMapper.Status + argumentMappingStatus = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(context.call, context.tracing, + candidateCall); + if (!argumentMappingStatus.isSuccess()) { + candidateCall.addStatus(OTHER_ERROR); + if (argumentMappingStatus == ValueArgumentsToParametersMapper.Status.ERROR) { + checkTypesWithNoCallee(context.toBasic()); + return; + } + } + + List jetTypeArguments = context.call.getTypeArguments(); + if (jetTypeArguments.isEmpty()) { + if (!candidate.getTypeParameters().isEmpty()) { + candidateCall.addStatus(inferTypeArguments(context)); + } + else { + candidateCall.addStatus(checkAllValueArguments(context)); + } + } + else { + // Explicit type arguments passed + + List typeArguments = new ArrayList(); + for (JetTypeProjection projection : jetTypeArguments) { + if (projection.getProjectionKind() != JetProjectionKind.NONE) { + context.trace.report(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT.on(projection)); + } + JetTypeReference typeReference = projection.getTypeReference(); + if (typeReference != null) { + typeArguments.add(typeResolver.resolveType(context.scope, typeReference, context.trace, true)); + } + else { + typeArguments.add(ErrorUtils.createErrorType("Star projection in a call")); + } + } + int expectedTypeArgumentCount = candidate.getTypeParameters().size(); + if (expectedTypeArgumentCount == jetTypeArguments.size()) { + + checkGenericBoundsInAFunctionCall(jetTypeArguments, typeArguments, candidate, context.trace); + + Map + substitutionContext = FunctionDescriptorUtil.createSubstitutionContext((FunctionDescriptor)candidate, typeArguments); + D substitutedDescriptor = (D) candidate.substitute(TypeSubstitutor.create(substitutionContext)); + + candidateCall.setResultingDescriptor(substitutedDescriptor); + replaceValueParametersWithSubstitutedOnes(candidateCall, substitutedDescriptor); + + List typeParameters = candidateCall.getCandidateDescriptor().getTypeParameters(); + for (int i = 0; i < typeParameters.size(); i++) { + TypeParameterDescriptor typeParameterDescriptor = typeParameters.get(i); + candidateCall.recordTypeArgument(typeParameterDescriptor, typeArguments.get(i)); + } + candidateCall.addStatus(checkAllValueArguments(context)); + } + else { + candidateCall.addStatus(OTHER_ERROR); + context.tracing.wrongNumberOfTypeArguments(context.trace, expectedTypeArgumentCount); + } + } + + task.performAdvancedChecks(candidate, context.trace, context.tracing); + + // 'super' cannot be passed as an argument, for receiver arguments expression typer does not track this + // See TaskPrioritizer for more + JetSuperExpression superExpression = TaskPrioritizer.getReceiverSuper(candidateCall.getReceiverArgument()); + if (superExpression != null) { + context.trace.report(SUPER_IS_NOT_AN_EXPRESSION.on(superExpression, superExpression.getText())); + candidateCall.addStatus(OTHER_ERROR); + } + + recordAutoCastIfNecessary(candidateCall.getReceiverArgument(), candidateCall.getTrace()); + recordAutoCastIfNecessary(candidateCall.getThisObject(), candidateCall.getTrace()); + } + private ResolutionStatus inferTypeArguments(CallResolutionContext context) { ResolvedCallImpl candidateCall = context.candidateCall; D candidate = candidateCall.getCandidateDescriptor(); @@ -843,25 +864,26 @@ public class CallResolver { @NotNull public OverloadResolutionResults resolveExactSignature(@NotNull JetScope scope, @NotNull ReceiverDescriptor receiver, @NotNull String name, @NotNull List parameterTypes) { - List> result = findCandidatesByExactSignature(scope, receiver, name, parameterTypes); + List> candidates = findCandidatesByExactSignature(scope, receiver, name, parameterTypes); BindingTraceContext trace = new BindingTraceContext(); TemporaryBindingTrace temporaryBindingTrace = TemporaryBindingTrace.create(trace); - Set> candidates = Sets.newLinkedHashSet(); - for (ResolvedCallImpl call : result) { + Set> calls = Sets.newLinkedHashSet(); + for (ResolutionCandidate candidate : candidates) { + ResolvedCallImpl call = ResolvedCallImpl.create(candidate); call.setTrace(temporaryBindingTrace); - candidates.add(call); + calls.add(call); } - return computeResultAndReportErrors(trace, TracingStrategy.EMPTY, candidates, Collections.>emptySet()); + return computeResultAndReportErrors(trace, TracingStrategy.EMPTY, calls, Collections.>emptySet()); } - private List> findCandidatesByExactSignature(JetScope scope, ReceiverDescriptor receiver, + private List> findCandidatesByExactSignature(JetScope scope, ReceiverDescriptor receiver, String name, List parameterTypes) { - List> result = Lists.newArrayList(); + List> result = Lists.newArrayList(); if (receiver.exists()) { - Collection> extensionFunctionDescriptors = ResolvedCallImpl.convertCollection(scope.getFunctions(name)); - List> nonlocal = Lists.newArrayList(); - List> local = Lists.newArrayList(); + Collection> extensionFunctionDescriptors = ResolutionCandidate.convertCollection(scope.getFunctions(name)); + List> nonlocal = Lists.newArrayList(); + List> local = Lists.newArrayList(); TaskPrioritizer.splitLexicallyLocalDescriptors(extensionFunctionDescriptors, scope.getContainingDeclaration(), local, nonlocal); @@ -869,7 +891,7 @@ public class CallResolver { return result; } - Collection> functionDescriptors = ResolvedCallImpl.convertCollection(receiver.getType().getMemberScope().getFunctions(name)); + Collection> functionDescriptors = ResolutionCandidate.convertCollection(receiver.getType().getMemberScope().getFunctions(name)); if (lookupExactSignature(functionDescriptors, parameterTypes, result)) { return result; @@ -878,16 +900,16 @@ public class CallResolver { return result; } else { - lookupExactSignature(ResolvedCallImpl.convertCollection(scope.getFunctions(name)), parameterTypes, result); + lookupExactSignature(ResolutionCandidate.convertCollection(scope.getFunctions(name)), parameterTypes, result); return result; } } - private static boolean lookupExactSignature(Collection> candidates, List parameterTypes, - List> result) { + private static boolean lookupExactSignature(Collection> candidates, List parameterTypes, + List> result) { boolean found = false; - for (ResolvedCallImpl resolvedCall : candidates) { - FunctionDescriptor functionDescriptor = resolvedCall.getResultingDescriptor(); + for (ResolutionCandidate resolvedCall : candidates) { + FunctionDescriptor functionDescriptor = resolvedCall.getDescriptor(); if (functionDescriptor.getReceiverParameter().exists()) continue; if (!functionDescriptor.getTypeParameters().isEmpty()) continue; if (!checkValueParameters(functionDescriptor, parameterTypes)) continue; @@ -897,17 +919,17 @@ public class CallResolver { return found; } - private boolean findExtensionFunctions(Collection> candidates, ReceiverDescriptor receiver, - List parameterTypes, List> result) { + private boolean findExtensionFunctions(Collection> candidates, ReceiverDescriptor receiver, + List parameterTypes, List> result) { boolean found = false; - for (ResolvedCallImpl resolvedCall : candidates) { - FunctionDescriptor functionDescriptor = resolvedCall.getResultingDescriptor(); + for (ResolutionCandidate candidate : candidates) { + FunctionDescriptor functionDescriptor = candidate.getDescriptor(); ReceiverDescriptor functionReceiver = functionDescriptor.getReceiverParameter(); if (!functionReceiver.exists()) continue; if (!functionDescriptor.getTypeParameters().isEmpty()) continue; if (!typeChecker.isSubtypeOf(receiver.getType(), functionReceiver.getType())) continue; if (!checkValueParameters(functionDescriptor, parameterTypes))continue; - result.add(resolvedCall); + result.add(candidate); found = true; } return found; @@ -923,15 +945,4 @@ public class CallResolver { } return true; } - - private static final class CallResolutionContext extends ResolutionContext { - /*package*/ final ResolvedCallImpl candidateCall; - /*package*/ final TracingStrategy tracing; - - public CallResolutionContext(ResolvedCallImpl candidateCall, ResolutionTask task, BindingTrace trace, TracingStrategy tracing) { - super(trace, task.scope, task.call, task.expectedType, task.dataFlowInfo); - this.candidateCall = candidateCall; - this.tracing = tracing; - } - } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformationStrategy.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformationStrategy.java new file mode 100644 index 00000000000..5fc68364ae5 --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformationStrategy.java @@ -0,0 +1,118 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.resolve.calls; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; +import org.jetbrains.jet.lang.descriptors.VariableDescriptor; +import org.jetbrains.jet.lang.psi.*; +import org.jetbrains.jet.lang.resolve.BindingTrace; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + * @author svtk + */ +public interface CallTransformationStrategy { + + @NotNull + CallResolutionContext createCallContext(@NotNull ResolutionCandidate candidate, + @NotNull ResolutionTask task, + @NotNull BindingTrace trace, + @NotNull TracingStrategy tracing); + + @NotNull + Collection> transformResultCall(@NotNull CallResolutionContext callResolutionContext, + @NotNull CallResolver callResolver, + @NotNull ResolutionTask task); + + CallTransformationStrategy + PROPERTY_CALL_TRANSFORMATION_STRATEGY = new CallTransformationStrategy() { + @NotNull + @Override + public CallResolutionContext createCallContext(@NotNull ResolutionCandidate candidate, + @NotNull ResolutionTask task, @NotNull BindingTrace trace, @NotNull TracingStrategy tracing) { + ResolvedCallImpl candidateCall = ResolvedCallImpl.create(candidate); + return new CallResolutionContext(candidateCall, task, trace, tracing); + } + + @NotNull + @Override + public Collection> transformResultCall(@NotNull CallResolutionContext context, + @NotNull CallResolver callResolver, @NotNull ResolutionTask task) { + return Collections.singleton(context.candidateCall); + } + }; + + CallTransformationStrategy + FUNCTION_CALL_TRANSFORMATION_STRATEGY = new CallTransformationStrategy() { + @NotNull + @Override + public CallResolutionContext createCallContext(@NotNull ResolutionCandidate candidate, + @NotNull ResolutionTask task, + @NotNull BindingTrace trace, + @NotNull TracingStrategy tracing) { + if (candidate.getDescriptor() instanceof FunctionDescriptor) { + return new CallResolutionContext(ResolvedCallImpl.create(candidate), task, trace, tracing); + } + assert candidate.getDescriptor() instanceof VariableDescriptor; + Call propertyCall = new DelegatingCall(task.call) { + @Override + public JetValueArgumentList getValueArgumentList() { + return null; + } + + @NotNull + @Override + public List getFunctionLiteralArguments() { + return Collections.emptyList(); + } + + @NotNull + @Override + public List getTypeArguments() { + return Collections.emptyList(); + } + + @Override + public JetTypeArgumentList getTypeArgumentList() { + return null; + } + }; + return new CallResolutionContext(ResolvedCallImpl.create(candidate), task, trace, tracing, propertyCall); + } + + @NotNull + @Override + public Collection> transformResultCall(@NotNull CallResolutionContext context, + @NotNull CallResolver callResolver, @NotNull ResolutionTask task) { + FunctionDescriptor descriptor = context.candidateCall.getCandidateDescriptor(); + if (descriptor instanceof FunctionDescriptor) { + return Collections.singleton(context.candidateCall); + } + assert descriptor instanceof VariableDescriptor; + BasicResolutionContext basicResolutionContext = + BasicResolutionContext.create(context.trace, context.scope, task.call, context.expectedType, context.dataFlowInfo); + OverloadResolutionResults results = + callResolver.resolveCallWithGivenName(basicResolutionContext, task.reference, "invoke"); + return ((OverloadResolutionResultsImpl)results).getResultingCalls(); + } + }; +} diff --git a/confluence/src/main/java/com/intellij/psi/tree/TokenSet.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizer.java similarity index 50% rename from confluence/src/main/java/com/intellij/psi/tree/TokenSet.java rename to compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizer.java index aa29a84d471..14dace99c4d 100644 --- a/confluence/src/main/java/com/intellij/psi/tree/TokenSet.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizer.java @@ -14,27 +14,25 @@ * limitations under the License. */ -package com.intellij.psi.tree; +package org.jetbrains.jet.lang.resolve.calls; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.resolve.scopes.JetScope; +import org.jetbrains.jet.lang.types.JetType; + +import java.util.Collection; /** - * @author abreslav + * @author svtk */ -public class TokenSet { - public static TokenSet create(IElementType... tokens) { - return new TokenSet(tokens); - } +public interface MemberPrioritizer { + @NotNull + Collection getNonExtensionsByName(JetScope scope, String name); - private final Set tokens = new HashSet(); + @NotNull + Collection getMembersByName(@NotNull JetType receiver, String name); - public TokenSet(IElementType... tokens) { - this.tokens.addAll(Arrays.asList(tokens)); - } - - public Set asSet() { - return tokens; - } + @NotNull + Collection getExtensionsByName(JetScope scope, String name); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizers.java similarity index 82% rename from compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.java rename to compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizers.java index 48e16fb27c1..a7e793dcb4a 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/MemberPrioritizers.java @@ -34,14 +34,15 @@ import java.util.*; /** * @author abreslav */ -public class TaskPrioritizers { +public class MemberPrioritizers { - /*package*/ static TaskPrioritizer FUNCTION_TASK_PRIORITIZER = new TaskPrioritizer() { + /*package*/ static MemberPrioritizer FUNCTION_TASK_PRIORITIZER = new MemberPrioritizer() { + @NotNull @Override - protected Collection getNonExtensionsByName(JetScope scope, String name) { + public Collection getNonExtensionsByName(JetScope scope, String name) { Set functions = Sets.newLinkedHashSet(scope.getFunctions(name)); for (Iterator iterator = functions.iterator(); iterator.hasNext(); ) { FunctionDescriptor functionDescriptor = iterator.next(); @@ -57,7 +58,7 @@ public class TaskPrioritizers { @NotNull @Override - protected Collection getMembersByName(@NotNull JetType receiverType, String name) { + public Collection getMembersByName(@NotNull JetType receiverType, String name) { JetScope receiverScope = receiverType.getMemberScope(); Set members = Sets.newHashSet(receiverScope.getFunctions(name)); addConstructors(receiverScope, name, members); @@ -67,7 +68,7 @@ public class TaskPrioritizers { @NotNull @Override - protected Collection getExtensionsByName(JetScope scope, String name) { + public Collection getExtensionsByName(JetScope scope, String name) { Set extensionFunctions = Sets.newHashSet(scope.getFunctions(name)); for (Iterator iterator = extensionFunctions.iterator(); iterator.hasNext(); ) { FunctionDescriptor descriptor = iterator.next(); @@ -104,11 +105,11 @@ public class TaskPrioritizers { } }; - /*package*/ static TaskPrioritizer VARIABLE_TASK_PRIORITIZER = new TaskPrioritizer() { + /*package*/ static MemberPrioritizer VARIABLE_TASK_PRIORITIZER = new MemberPrioritizer() { @NotNull @Override - protected Collection getNonExtensionsByName(JetScope scope, String name) { + public Collection getNonExtensionsByName(JetScope scope, String name) { VariableDescriptor descriptor = scope.getLocalVariable(name); if (descriptor == null) { descriptor = DescriptorUtils.filterNonExtensionProperty(scope.getProperties(name)); @@ -119,13 +120,13 @@ public class TaskPrioritizers { @NotNull @Override - protected Collection getMembersByName(@NotNull JetType receiverType, String name) { + public Collection getMembersByName(@NotNull JetType receiverType, String name) { return receiverType.getMemberScope().getProperties(name); } @NotNull @Override - protected Collection getExtensionsByName(JetScope scope, String name) { + public Collection getExtensionsByName(JetScope scope, String name) { return Collections2.filter(scope.getProperties(name), new Predicate() { @Override public boolean apply(@Nullable VariableDescriptor variableDescriptor) { @@ -135,7 +136,7 @@ public class TaskPrioritizers { } }; - /*package*/ static TaskPrioritizer PROPERTY_TASK_PRIORITIZER = new TaskPrioritizer() { + /*package*/ static MemberPrioritizer PROPERTY_TASK_PRIORITIZER = new MemberPrioritizer() { private Collection filterProperties(Collection variableDescriptors) { ArrayList properties = Lists.newArrayList(); for (VariableDescriptor descriptor : variableDescriptors) { @@ -148,19 +149,19 @@ public class TaskPrioritizers { @NotNull @Override - protected Collection getNonExtensionsByName(JetScope scope, String name) { + public Collection getNonExtensionsByName(JetScope scope, String name) { return filterProperties(VARIABLE_TASK_PRIORITIZER.getNonExtensionsByName(scope, name)); } @NotNull @Override - protected Collection getMembersByName(@NotNull JetType receiver, String name) { + public Collection getMembersByName(@NotNull JetType receiver, String name) { return filterProperties(VARIABLE_TASK_PRIORITIZER.getMembersByName(receiver, name)); } @NotNull @Override - protected Collection getExtensionsByName(JetScope scope, String name) { + public Collection getExtensionsByName(JetScope scope, String name) { return filterProperties(VARIABLE_TASK_PRIORITIZER.getExtensionsByName(scope, name)); } }; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.java index 44c37c97435..1edce3205fa 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.java @@ -25,10 +25,10 @@ import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.OverridingUtil; import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor; -import org.jetbrains.jet.lang.types.checker.JetTypeChecker; -import org.jetbrains.jet.lang.types.lang.JetStandardLibrary; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.TypeUtils; +import org.jetbrains.jet.lang.types.checker.JetTypeChecker; +import org.jetbrains.jet.lang.types.lang.JetStandardLibrary; import java.util.List; import java.util.Set; @@ -95,29 +95,73 @@ public class OverloadingConflictResolver { int fSize = fParams.size(); int gSize = gParams.size(); - if (fSize > gSize) return false; - for (int i = 0; i < gSize; i++) { - ValueParameterDescriptor gParam = gParams.get(i); - JetType gParamType = gParam.getType(); - if (i >= fSize) { - // f() has fewer parameters than g() - // The point is: g() may have a last vararg that doesn't get any arguments - // In this case f() is more specific, because one can explicitly pass - // an empty array to g() and make it preferred - if (i != gSize - 1 || gParam.getVarargElementType() == null) { + boolean fIsVararg = isVariableArity(fParams); + boolean gIsVararg = isVariableArity(gParams); + + if (!fIsVararg && gIsVararg) return true; + if (fIsVararg && !gIsVararg) return false; + + if (!fIsVararg && !gIsVararg) { + if (fSize != gSize) return false; + + for (int i = 0; i < fSize; i++) { + ValueParameterDescriptor fParam = fParams.get(i); + ValueParameterDescriptor gParam = gParams.get(i); + + JetType fParamType = fParam.getType(); + JetType gParamType = gParam.getType(); + + if (!typeMoreSpecific(fParamType, gParamType)) { return false; } - return true; - } - - JetType fParamType = fParams.get(i).getType(); - - if (!typeMoreSpecific(fParamType, gParamType)) { - return false; } } - + + if (fIsVararg && gIsVararg) { + // Check matching parameters + int minSize = Math.min(fSize, gSize); + for (int i = 0; i < minSize - 1; i++) { + ValueParameterDescriptor fParam = fParams.get(i); + ValueParameterDescriptor gParam = gParams.get(i); + + JetType fParamType = fParam.getType(); + JetType gParamType = gParam.getType(); + + if (!typeMoreSpecific(fParamType, gParamType)) { + return false; + } + } + + // Check the non-matching parameters of one function against the vararg parameter of the other funciton + // Example: + // f(a : A, vararg vf : T) + // g(vararg vg : T) + // here we check that typeof(a) < typeof(vg) and elementTypeOf(vf) < elementTypeOf(vg) + if (fSize < gSize) { + ValueParameterDescriptor fParam = fParams.get(fSize - 1); + JetType fParamType = fParam.getVarargElementType(); + assert fParamType != null : "fIsVararg guarantees this"; + for (int i = fSize - 1; i < gSize; i++) { + ValueParameterDescriptor gParam = gParams.get(i); + if (!typeMoreSpecific(fParamType, gParam.getType())) { + return false; + } + } + } + else { + ValueParameterDescriptor gParam = gParams.get(gSize - 1); + JetType gParamType = gParam.getVarargElementType(); + assert gParamType != null : "gIsVararg guarantees this"; + for (int i = gSize - 1; i < fSize; i++) { + ValueParameterDescriptor fParam = fParams.get(i); + if (!typeMoreSpecific(fParam.getType(), gParamType)) { + return false; + } + } + } + } + if (discriminateGenericDescriptors && isGeneric(f)) { if (!isGeneric(g)) { return false; @@ -130,7 +174,12 @@ public class OverloadingConflictResolver { return true; } - + + private boolean isVariableArity(List fParams) { + int fSize = fParams.size(); + return fSize > 0 && fParams.get(fSize - 1).getVarargElementType() != null; + } + private boolean isGeneric(CallableDescriptor f) { return !f.getOriginal().getTypeParameters().isEmpty(); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionCandidate.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionCandidate.java new file mode 100644 index 00000000000..829185e3e31 --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionCandidate.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.resolve.calls; + +import com.google.common.collect.Lists; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor; + +import java.util.Collection; +import java.util.List; + +import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor.NO_RECEIVER; + +/** + * @author svtk + */ +public class ResolutionCandidate { + private final D candidateDescriptor; + private ReceiverDescriptor thisObject = NO_RECEIVER; // receiver object of a method + private ReceiverDescriptor receiverArgument = NO_RECEIVER; // receiver of an extension function + + private ResolutionCandidate(@NotNull D descriptor) { + candidateDescriptor = descriptor; + } + + public static ResolutionCandidate create(@NotNull D descriptor) { + return new ResolutionCandidate(descriptor); + } + + public void setThisObject(@NotNull ReceiverDescriptor thisObject) { + this.thisObject = thisObject; + } + + public void setReceiverArgument(@NotNull ReceiverDescriptor receiverArgument) { + this.receiverArgument = receiverArgument; + } + + @NotNull + public D getDescriptor() { + return candidateDescriptor; + } + + @NotNull + public ReceiverDescriptor getThisObject() { + return thisObject; + } + + @NotNull + public ReceiverDescriptor getReceiverArgument() { + return receiverArgument; + } + + @NotNull + public static List> convertCollection(@NotNull Collection descriptors) { + List> result = Lists.newArrayList(); + for (D descriptor : descriptors) { + result.add(create(descriptor)); + } + return result; + } + +} diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.java index 5e53fbb25aa..d1584abad00 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.java @@ -49,7 +49,7 @@ public enum ResolutionStatus { } public ResolutionStatus combine(ResolutionStatus other) { - if (this.isSuccess()) return other; + if (this == UNKNOWN_STATUS || this.isSuccess()) return other; if (!other.isSuccess() && this.getSeverityIndex() < other.getSeverityIndex()) return other; return this; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java index 32f3873ee83..3f7468a0479 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.java @@ -16,6 +16,8 @@ package org.jetbrains.jet.lang.resolve.calls; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Multimap; import com.google.common.collect.Sets; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; @@ -39,10 +41,7 @@ import java.util.Collection; import java.util.List; import static org.jetbrains.jet.lang.diagnostics.Errors.*; -import static org.jetbrains.jet.lang.diagnostics.Errors.DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED; -import static org.jetbrains.jet.lang.resolve.BindingContext.AMBIGUOUS_REFERENCE_TARGET; -import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; -import static org.jetbrains.jet.lang.resolve.BindingContext.RESOLVED_CALL; +import static org.jetbrains.jet.lang.resolve.BindingContext.*; /** * Stores candidates for call resolution. @@ -50,26 +49,32 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.RESOLVED_CALL; * @author abreslav */ public class ResolutionTask extends ResolutionContext { - private final Collection> candidates; + private final Collection> candidates; + private final Multimap, ResolvedCallImpl> resolvedCallMap = LinkedHashMultimap.create(); /*package*/ final JetReferenceExpression reference; private DescriptorCheckStrategy checkingStrategy; - public ResolutionTask(@NotNull Collection> candidates, @NotNull JetReferenceExpression reference, + public ResolutionTask(@NotNull Collection> candidates, @NotNull JetReferenceExpression reference, BindingTrace trace, JetScope scope, Call call, JetType expectedType, DataFlowInfo dataFlowInfo) { super(trace, scope, call, expectedType, dataFlowInfo); this.candidates = candidates; this.reference = reference; } - public ResolutionTask(@NotNull Collection> candidates, @NotNull JetReferenceExpression reference, @NotNull BasicResolutionContext context) { + public ResolutionTask(@NotNull Collection> candidates, @NotNull JetReferenceExpression reference, @NotNull BasicResolutionContext context) { this(candidates, reference, context.trace, context.scope, context.call, context.expectedType, context.dataFlowInfo); } @NotNull - public Collection> getCandidates() { + public Collection> getCandidates() { return candidates; } + @NotNull + public Multimap, ResolvedCallImpl> getResolvedCallMap() { + return resolvedCallMap; + } + public void setCheckingStrategy(DescriptorCheckStrategy strategy) { checkingStrategy = strategy; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTaskHolder.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTaskHolder.java index 4b27a266b07..4e39c8ccfde 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTaskHolder.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolutionTaskHolder.java @@ -34,35 +34,35 @@ import java.util.List; public class ResolutionTaskHolder { private final JetReferenceExpression reference; private final BasicResolutionContext basicResolutionContext; - private final Predicate> visibleStrategy; + private final Predicate> visibleStrategy; - private final Collection>> localExtensions = Sets.newLinkedHashSet(); - private final Collection>> members = Sets.newLinkedHashSet(); - private final Collection>> nonLocalExtensions = Sets.newLinkedHashSet(); + private final Collection>> localExtensions = Sets.newLinkedHashSet(); + private final Collection>> members = Sets.newLinkedHashSet(); + private final Collection>> nonLocalExtensions = Sets.newLinkedHashSet(); private List> tasks = null; public ResolutionTaskHolder(@NotNull JetReferenceExpression reference, @NotNull BasicResolutionContext basicResolutionContext, - @NotNull Predicate> visibleStrategy) { + @NotNull Predicate> visibleStrategy) { this.reference = reference; this.basicResolutionContext = basicResolutionContext; this.visibleStrategy = visibleStrategy; } - public void addLocalExtensions(@NotNull Collection> candidates) { + public void addLocalExtensions(@NotNull Collection> candidates) { if (!candidates.isEmpty()) { localExtensions.add(candidates); } } - public void addMembers(@NotNull Collection> candidates) { + public void addMembers(@NotNull Collection> candidates) { if (!candidates.isEmpty()) { members.add(candidates); } } - public void addNonLocalExtensions(@NotNull Collection> candidates) { + public void addNonLocalExtensions(@NotNull Collection> candidates) { if (!candidates.isEmpty()) { nonLocalExtensions.add(candidates); } @@ -71,7 +71,7 @@ public class ResolutionTaskHolder { public List> getTasks() { if (tasks == null) { tasks = Lists.newArrayList(); - List>> candidateList = Lists.newArrayList(); + List>> candidateList = Lists.newArrayList(); // If the call is of the form super.foo(), it can actually be only a member // But if there's no appropriate member, we would like to report that super cannot be a receiver for an extension // Thus, put members first @@ -85,9 +85,9 @@ public class ResolutionTaskHolder { } candidateList.addAll(nonLocalExtensions); - for (Predicate> visibilityStrategy : Lists.newArrayList(visibleStrategy, Predicates.not(visibleStrategy))) { - for (Collection> candidates : candidateList) { - Collection> filteredCandidates = Collections2.filter(candidates, visibilityStrategy); + for (Predicate> visibilityStrategy : Lists.newArrayList(visibleStrategy, Predicates.not(visibleStrategy))) { + for (Collection> candidates : candidateList) { + Collection> filteredCandidates = Collections2.filter(candidates, visibilityStrategy); if (!filteredCandidates.isEmpty()) { tasks.add(new ResolutionTask(filteredCandidates, reference, basicResolutionContext)); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java index 771cca8c841..2bf2516e751 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java @@ -33,7 +33,6 @@ import java.util.List; import java.util.Map; import static org.jetbrains.jet.lang.resolve.calls.ResolutionStatus.UNKNOWN_STATUS; -import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor.NO_RECEIVER; /** * @author abreslav @@ -55,23 +54,14 @@ public class ResolvedCallImpl implements ResolvedC }; @NotNull - public static ResolvedCallImpl create(@NotNull D descriptor) { - return new ResolvedCallImpl(descriptor); - } - - @NotNull - public static List> convertCollection(@NotNull Collection descriptors) { - List> result = Lists.newArrayList(); - for (D descriptor : descriptors) { - result.add(create(descriptor)); - } - return result; + public static ResolvedCallImpl create(@NotNull ResolutionCandidate candidate) { + return new ResolvedCallImpl(candidate.getDescriptor(), candidate.getThisObject(), candidate.getReceiverArgument()); } private final D candidateDescriptor; private D resultingDescriptor; // Probably substituted - private ReceiverDescriptor thisObject = NO_RECEIVER; // receiver object of a method - private ReceiverDescriptor receiverArgument = NO_RECEIVER; // receiver of an extension function + private final ReceiverDescriptor thisObject; // receiver object of a method + private final ReceiverDescriptor receiverArgument; // receiver of an extension function private final Map typeArguments = Maps.newLinkedHashMap(); private final Map autoCasts = Maps.newHashMap(); @@ -80,8 +70,10 @@ public class ResolvedCallImpl implements ResolvedC private TemporaryBindingTrace trace; private ResolutionStatus status = UNKNOWN_STATUS; - private ResolvedCallImpl(@NotNull D candidateDescriptor) { + private ResolvedCallImpl(@NotNull D candidateDescriptor, @NotNull ReceiverDescriptor thisObject, @NotNull ReceiverDescriptor receiverArgument) { this.candidateDescriptor = candidateDescriptor; + this.thisObject = thisObject; + this.receiverArgument = receiverArgument; } @NotNull @@ -89,8 +81,8 @@ public class ResolvedCallImpl implements ResolvedC return status; } - public void setStatus(@NotNull ResolutionStatus status) { - this.status = status; + public void addStatus(@NotNull ResolutionStatus status) { + this.status = this.status.combine(status); } @NotNull @@ -140,20 +132,12 @@ public class ResolvedCallImpl implements ResolvedC return receiverArgument; } - public void setReceiverArgument(@NotNull ReceiverDescriptor receiverParameter) { - this.receiverArgument = receiverParameter; - } - @Override @NotNull public ReceiverDescriptor getThisObject() { return thisObject; } - public void setThisObject(@NotNull ReceiverDescriptor thisObject) { - this.thisObject = thisObject; - } - @Override @NotNull public Map getValueArguments() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.java index 5492bb2c921..6a1cd61c00f 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.java @@ -31,7 +31,6 @@ import org.jetbrains.jet.lang.resolve.scopes.receivers.ClassReceiver; import org.jetbrains.jet.lang.resolve.scopes.receivers.ExpressionReceiver; import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor; import org.jetbrains.jet.lang.types.ErrorUtils; -import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.NamespaceType; import org.jetbrains.jet.lang.types.checker.JetTypeChecker; @@ -44,16 +43,16 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor /** * @author abreslav */ -/*package*/ abstract class TaskPrioritizer { +/*package*/ abstract class TaskPrioritizer { public static void splitLexicallyLocalDescriptors( - @NotNull Collection> allDescriptors, + @NotNull Collection> allDescriptors, @NotNull DeclarationDescriptor containerOfTheCurrentLocality, - @NotNull Collection> local, - @NotNull Collection> nonlocal + @NotNull Collection> local, + @NotNull Collection> nonlocal ) { - for (ResolvedCallImpl resolvedCall : allDescriptors) { - if (DescriptorUtils.isLocal(containerOfTheCurrentLocality, resolvedCall.getCandidateDescriptor())) { + for (ResolutionCandidate resolvedCall : allDescriptors) { + if (DescriptorUtils.isLocal(containerOfTheCurrentLocality, resolvedCall.getDescriptor())) { local.add(resolvedCall); } else { @@ -75,8 +74,8 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor } @NotNull - public List> computePrioritizedTasks(@NotNull BasicResolutionContext context, @NotNull String name, - @NotNull JetReferenceExpression functionReference) { + public static List> computePrioritizedTasks(@NotNull BasicResolutionContext context, @NotNull String name, + @NotNull JetReferenceExpression functionReference, @NotNull List> memberPrioritizers) { ReceiverDescriptor explicitReceiver = context.call.getExplicitReceiver(); final JetScope scope; if (explicitReceiver.exists() && explicitReceiver.getType() instanceof NamespaceType) { @@ -87,40 +86,41 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor else { scope = context.scope; } - final Predicate> visibleStrategy = new Predicate>() { + final Predicate> visibleStrategy = new Predicate>() { @Override - public boolean apply(@Nullable ResolvedCallImpl call) { + public boolean apply(@Nullable ResolutionCandidate call) { if (call == null) return false; - D candidateDescriptor = call.getCandidateDescriptor(); + D candidateDescriptor = call.getDescriptor(); if (ErrorUtils.isError(candidateDescriptor)) return true; return Visibilities.isVisible(candidateDescriptor, scope.getContainingDeclaration()); } }; ResolutionTaskHolder result = new ResolutionTaskHolder(functionReference, context, visibleStrategy ); - doComputeTasks(scope, explicitReceiver, name, result, context); + doComputeTasks(scope, explicitReceiver, name, result, context, memberPrioritizers); return result.getTasks(); } - private void doComputeTasks(@NotNull JetScope scope, @NotNull ReceiverDescriptor receiver, + private static void doComputeTasks(@NotNull JetScope scope, @NotNull ReceiverDescriptor receiver, @NotNull String name, @NotNull ResolutionTaskHolder result, - @NotNull BasicResolutionContext context) { + @NotNull BasicResolutionContext context, @NotNull List> memberPrioritizers) { + MemberPrioritizer memberPrioritizer = memberPrioritizers.get(0); AutoCastServiceImpl autoCastService = new AutoCastServiceImpl(context.dataFlowInfo, context.trace.getBindingContext()); List implicitReceivers = Lists.newArrayList(); scope.getImplicitReceiversHierarchy(implicitReceivers); if (receiver.exists()) { List variantsForExplicitReceiver = autoCastService.getVariantsForReceiver(receiver); - Collection> extensionFunctions = convertWithImpliedThis(scope, variantsForExplicitReceiver, getExtensionsByName(scope, name)); - List> nonlocals = Lists.newArrayList(); - List> locals = Lists.newArrayList(); + Collection> extensionFunctions = convertWithImpliedThis(scope, variantsForExplicitReceiver, memberPrioritizer.getExtensionsByName(scope, name)); + List> nonlocals = Lists.newArrayList(); + List> locals = Lists.newArrayList(); //noinspection unchecked,RedundantTypeArguments TaskPrioritizer.splitLexicallyLocalDescriptors(extensionFunctions, scope.getContainingDeclaration(), locals, nonlocals); - Collection> members = Lists.newArrayList(); + Collection> members = Lists.newArrayList(); for (ReceiverDescriptor variant : variantsForExplicitReceiver) { - Collection membersForThisVariant = getMembersByName(variant.getType(), name); + Collection membersForThisVariant = memberPrioritizer.getMembersByName(variant.getType(), name); convertWithReceivers(membersForThisVariant, Collections.singletonList(variant), Collections.singletonList(NO_RECEIVER), members); } @@ -128,7 +128,7 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor result.addMembers(members); for (ReceiverDescriptor implicitReceiver : implicitReceivers) { - Collection memberExtensions = getExtensionsByName(implicitReceiver.getType().getMemberScope(), name); + Collection memberExtensions = memberPrioritizer.getExtensionsByName(implicitReceiver.getType().getMemberScope(), name); List variantsForImplicitReceiver = autoCastService.getVariantsForReceiver(implicitReceiver); result.addNonLocalExtensions(convertWithReceivers(memberExtensions, variantsForImplicitReceiver, variantsForExplicitReceiver)); } @@ -136,10 +136,10 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor result.addNonLocalExtensions(nonlocals); } else { - Collection> functions = convertWithImpliedThis(scope, Collections.singletonList(receiver), getNonExtensionsByName(scope, name)); + Collection> functions = convertWithImpliedThis(scope, Collections.singletonList(receiver), memberPrioritizer.getNonExtensionsByName(scope, name)); - List> nonlocals = Lists.newArrayList(); - List> locals = Lists.newArrayList(); + List> nonlocals = Lists.newArrayList(); + List> locals = Lists.newArrayList(); //noinspection unchecked,RedundantTypeArguments TaskPrioritizer.splitLexicallyLocalDescriptors(functions, scope.getContainingDeclaration(), locals, nonlocals); @@ -147,22 +147,22 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor result.addNonLocalExtensions(nonlocals); for (ReceiverDescriptor implicitReceiver : implicitReceivers) { - doComputeTasks(scope, implicitReceiver, name, result, context); + doComputeTasks(scope, implicitReceiver, name, result, context, memberPrioritizers); } } } - private Collection> convertWithReceivers(Collection descriptors, Iterable thisObjects, Iterable receiverParameters) { - Collection> result = Lists.newArrayList(); + private static Collection> convertWithReceivers(Collection descriptors, Iterable thisObjects, Iterable receiverParameters) { + Collection> result = Lists.newArrayList(); convertWithReceivers(descriptors, thisObjects, receiverParameters, result); return result; } - private void convertWithReceivers(Collection descriptors, Iterable thisObjects, Iterable receiverParameters, Collection> result) { + private static void convertWithReceivers(Collection descriptors, Iterable thisObjects, Iterable receiverParameters, Collection> result) { for (ReceiverDescriptor thisObject : thisObjects) { for (ReceiverDescriptor receiverParameter : receiverParameters) { for (D extension : descriptors) { - ResolvedCallImpl resolvedCall = ResolvedCallImpl.create(extension); + ResolutionCandidate resolvedCall = ResolutionCandidate.create(extension); resolvedCall.setThisObject(thisObject); resolvedCall.setReceiverArgument(receiverParameter); result.add(resolvedCall); @@ -171,11 +171,11 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor } } - public static Collection> convertWithImpliedThis(JetScope scope, Iterable receiverParameters, Collection descriptors) { - Collection> result = Lists.newArrayList(); + public static Collection> convertWithImpliedThis(JetScope scope, Iterable receiverParameters, Collection descriptors) { + Collection> result = Lists.newArrayList(); for (ReceiverDescriptor receiverParameter : receiverParameters) { for (D descriptor : descriptors) { - ResolvedCallImpl resolvedCall = ResolvedCallImpl.create(descriptor); + ResolutionCandidate resolvedCall = ResolutionCandidate.create(descriptor); resolvedCall.setReceiverArgument(receiverParameter); if (setImpliedThis(scope, resolvedCall)) { result.add(resolvedCall); @@ -190,7 +190,7 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor containingDeclaration = containingDeclaration.getContainingDeclaration(); } if (containingDeclaration instanceof ClassDescriptor && ((ClassDescriptor) containingDeclaration).getKind() == ClassKind.OBJECT) { - ResolvedCallImpl resolvedCall = ResolvedCallImpl.create(descriptor); + ResolutionCandidate resolvedCall = ResolutionCandidate.create(descriptor); resolvedCall.setThisObject(new ClassReceiver((ClassDescriptor) containingDeclaration)); result.add(resolvedCall); } @@ -199,8 +199,8 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor return result; } - private static boolean setImpliedThis(@NotNull JetScope scope, ResolvedCallImpl resolvedCall) { - ReceiverDescriptor expectedThisObject = resolvedCall.getCandidateDescriptor().getExpectedThisObject(); + private static boolean setImpliedThis(@NotNull JetScope scope, ResolutionCandidate resolvedCall) { + ReceiverDescriptor expectedThisObject = resolvedCall.getDescriptor().getExpectedThisObject(); if (!expectedThisObject.exists()) return true; List receivers = Lists.newArrayList(); scope.getImplicitReceiversHierarchy(receivers); @@ -213,13 +213,4 @@ import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor } return false; } - - @NotNull - protected abstract Collection getNonExtensionsByName(JetScope scope, String name); - - @NotNull - protected abstract Collection getMembersByName(@NotNull JetType receiver, String name); - - @NotNull - protected abstract Collection getExtensionsByName(JetScope scope, String name); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.java index b0310bafbef..e88d16dd086 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.java @@ -33,17 +33,49 @@ import java.util.Set; import static org.jetbrains.jet.lang.diagnostics.Errors.*; import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; +import static org.jetbrains.jet.lang.resolve.calls.ValueArgumentsToParametersMapper.Status.ERROR; +import static org.jetbrains.jet.lang.resolve.calls.ValueArgumentsToParametersMapper.Status.OK; +import static org.jetbrains.jet.lang.resolve.calls.ValueArgumentsToParametersMapper.Status.WEAK_ERROR; /** * @author abreslav */ /*package*/ class ValueArgumentsToParametersMapper { - public static boolean mapValueArgumentsToParameters( + + public enum Status { + ERROR(false), + WEAK_ERROR(false), + OK(true); + + private final boolean success; + + private Status(boolean success) { + this.success = success; + } + + public boolean isSuccess() { + return success; + } + + public Status compose(Status other) { + switch (other) { + case ERROR: + return ERROR; + case WEAK_ERROR: + if (this != ERROR) { + return WEAK_ERROR; + } + default: + return this; + } + } + } + + public static Status mapValueArgumentsToParameters( @NotNull Call call, @NotNull TracingStrategy tracing, @NotNull ResolvedCallImpl candidateCall ) { - TemporaryBindingTrace temporaryTrace = candidateCall.getTrace(); Map varargs = Maps.newHashMap(); Set usedParameters = Sets.newHashSet(); @@ -61,7 +93,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; List valueArguments = call.getValueArguments(); - boolean error = false; + Status status = OK; boolean someNamed = false; boolean somePositioned = false; for (int i = 0; i < valueArguments.size(); i++) { @@ -72,47 +104,47 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; ValueParameterDescriptor valueParameterDescriptor = parameterByName.get(nameReference.getReferencedName()); if (valueParameterDescriptor == null) { temporaryTrace.report(NAMED_PARAMETER_NOT_FOUND.on(nameReference)); - error = true; + status = ERROR; } else { if (!usedParameters.add(valueParameterDescriptor)) { temporaryTrace.report(ARGUMENT_PASSED_TWICE.on(nameReference)); } temporaryTrace.record(REFERENCE_TARGET, nameReference, valueParameterDescriptor); - put(candidateCall, valueParameterDescriptor, valueArgument, varargs); + status = status.compose(put(candidateCall, valueParameterDescriptor, valueArgument, varargs)); } if (somePositioned) { temporaryTrace.report(MIXING_NAMED_AND_POSITIONED_ARGUMENTS.on(nameReference)); - error = true; + status = ERROR; } } else { somePositioned = true; if (someNamed) { temporaryTrace.report(MIXING_NAMED_AND_POSITIONED_ARGUMENTS.on(valueArgument.asElement())); - error = true; + status = ERROR; } else { int parameterCount = valueParameters.size(); if (i < parameterCount) { ValueParameterDescriptor valueParameterDescriptor = valueParameters.get(i); usedParameters.add(valueParameterDescriptor); - put(candidateCall, valueParameterDescriptor, valueArgument, varargs); + status = status.compose(put(candidateCall, valueParameterDescriptor, valueArgument, varargs)); } else if (!valueParameters.isEmpty()) { ValueParameterDescriptor valueParameterDescriptor = valueParameters.get(valueParameters.size() - 1); if (valueParameterDescriptor.getVarargElementType() != null) { - put(candidateCall, valueParameterDescriptor, valueArgument, varargs); + status = status.compose(put(candidateCall, valueParameterDescriptor, valueArgument, varargs)); usedParameters.add(valueParameterDescriptor); } else { temporaryTrace.report(TOO_MANY_ARGUMENTS.on(valueArgument.asElement(), candidate)); - error = true; + status = ERROR; } } else { temporaryTrace.report(TOO_MANY_ARGUMENTS.on(valueArgument.asElement(), candidate)); - error = true; + status = ERROR; } } } @@ -124,7 +156,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; if (valueParameters.isEmpty()) { temporaryTrace.report(TOO_MANY_ARGUMENTS.on(possiblyLabeledFunctionLiteral, candidate)); - error = true; + status = ERROR; } else { JetFunctionLiteralExpression functionLiteral; @@ -139,15 +171,15 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; ValueParameterDescriptor valueParameterDescriptor = valueParameters.get(valueParameters.size() - 1); if (valueParameterDescriptor.getVarargElementType() != null) { temporaryTrace.report(VARARG_OUTSIDE_PARENTHESES.on(possiblyLabeledFunctionLiteral)); - error = true; + status = ERROR; } else { if (!usedParameters.add(valueParameterDescriptor)) { temporaryTrace.report(TOO_MANY_ARGUMENTS.on(possiblyLabeledFunctionLiteral, candidate)); - error = true; + status = ERROR; } else { - put(candidateCall, valueParameterDescriptor, CallMaker.makeValueArgument(functionLiteral), varargs); + status = status.compose(put(candidateCall, valueParameterDescriptor, CallMaker.makeValueArgument(functionLiteral), varargs)); } } } @@ -155,7 +187,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; for (int i = 1; i < functionLiteralArguments.size(); i++) { JetExpression argument = functionLiteralArguments.get(i); temporaryTrace.report(MANY_FUNCTION_LITERAL_ARGUMENTS.on(argument)); - error = true; + status = ERROR; } } @@ -171,7 +203,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; else { // tracing.reportWrongValueArguments(temporaryTrace, "No value passed for parameter " + valueParameter.getName()); tracing.noValueForParameter(temporaryTrace, valueParameter); - error = true; + status = ERROR; } } } @@ -180,21 +212,22 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; ReceiverDescriptor receiverArgument = candidateCall.getReceiverArgument(); if (receiverParameter.exists() &&!receiverArgument.exists()) { tracing.missingReceiver(temporaryTrace, receiverParameter); - error = true; + status = ERROR; } if (!receiverParameter.exists() && receiverArgument.exists()) { tracing.noReceiverAllowed(temporaryTrace); - error = true; + status = ERROR; } if (candidateCall.getThisObject().exists() != candidateCall.getResultingDescriptor().getExpectedThisObject().exists()) { assert false : "Shouldn't happen because of TaskPrioritizer: " + candidateCall.getCandidateDescriptor(); } - return error; + return status; } - private static void put(ResolvedCallImpl candidateCall, ValueParameterDescriptor valueParameterDescriptor, ValueArgument valueArgument, Map varargs) { + private static Status put(ResolvedCallImpl candidateCall, ValueParameterDescriptor valueParameterDescriptor, ValueArgument valueArgument, Map varargs) { + Status error = OK; if (valueParameterDescriptor.getVarargElementType() != null) { VarargValueArgument vararg = varargs.get(valueParameterDescriptor); if (vararg == null) { @@ -207,11 +240,13 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET; else { LeafPsiElement spread = valueArgument.getSpreadElement(); if (spread != null) { - candidateCall.getTrace().report(NON_VARARG_SPREAD.on(spread)); + candidateCall.getTrace().report(NON_VARARG_SPREAD.on(spread)); + error = WEAK_ERROR; } ResolvedValueArgument argument = new ExpressionValueArgument(valueArgument); candidateCall.recordValueArgument(valueParameterDescriptor, argument); } + return error; } /** diff --git a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/JetLightClass.java b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/JetLightClass.java index 0108405be00..ba04aeacfba 100644 --- a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/JetLightClass.java +++ b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/JetLightClass.java @@ -44,6 +44,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.analyzer.AnalyzeExhaust; import org.jetbrains.jet.codegen.ClassBuilder; import org.jetbrains.jet.codegen.ClassBuilderFactory; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.CompilationErrorHandler; import org.jetbrains.jet.codegen.GenerationState; import org.jetbrains.jet.lang.psi.JetFile; @@ -141,6 +142,12 @@ public class JetLightClass extends AbstractLightClass implements JetJavaMirrorMa final Stack stubStack = new Stack(); final ClassBuilderFactory builderFactory = new ClassBuilderFactory() { + @NotNull + @Override + public ClassBuilderMode getClassBuilderMode() { + return ClassBuilderMode.SIGNATURES; + } + @Override public ClassBuilder newClassBuilder() { return new StubClassBuilder(stubStack); diff --git a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/StubClassBuilder.java b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/StubClassBuilder.java index 3939934acdd..f9b40f80121 100644 --- a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/StubClassBuilder.java +++ b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/StubClassBuilder.java @@ -107,9 +107,4 @@ public class StubClassBuilder extends ClassBuilder { } super.done(); } - - @Override - public Mode generateCode() { - return Mode.SIGNATURES; - } } diff --git a/compiler/testData/diagnostics/tests/varargs/MoreSpecificVarargsOfEqualLength.jet b/compiler/testData/diagnostics/tests/varargs/MoreSpecificVarargsOfEqualLength.jet new file mode 100644 index 00000000000..ef8688c4899 --- /dev/null +++ b/compiler/testData/diagnostics/tests/varargs/MoreSpecificVarargsOfEqualLength.jet @@ -0,0 +1,9 @@ +fun main(d : D) { + d.from("") + d.from(1) +} + +class D { + fun from(vararg a : Any){} + fun from(vararg a : String){} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.jet b/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.jet new file mode 100644 index 00000000000..dcc1d93ae4b --- /dev/null +++ b/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.jet @@ -0,0 +1,19 @@ +// FILE: kotlin.kt +fun main(j : C, s : Array) { + j.from() + j.from("") + j.from("", "") + j.from("", "", "") + + j.from("", *s) // This should not be an ambiguity, see KT-1842 + j.from(*s) +} + +// FILE: C.java +public class C { + void from() {} + void from(String s) {} + void from(String s, String s1) {} + void from(String... s) {} + void from(String s1, String... s) {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/kt1835.jet b/compiler/testData/diagnostics/tests/varargs/kt1835.jet new file mode 100644 index 00000000000..05c178d3994 --- /dev/null +++ b/compiler/testData/diagnostics/tests/varargs/kt1835.jet @@ -0,0 +1,12 @@ +// FILE: JavaClass.java +public class JavaClass { + void from(String s) {} + void from(String... s) {} +} + +// FILE: kotlin.kt +fun main(args : Array) { + JavaClass().from() + JavaClass().from("") + JavaClass().from("", "") +} \ No newline at end of file diff --git a/compiler/testData/resolve/varargs/MoreSpecificVarargsOfEqualLength.jet b/compiler/testData/resolve/varargs/MoreSpecificVarargsOfEqualLength.jet new file mode 100644 index 00000000000..d255c714f37 --- /dev/null +++ b/compiler/testData/resolve/varargs/MoreSpecificVarargsOfEqualLength.jet @@ -0,0 +1,9 @@ +fun main(d : D) { + d.`str`from("") + d.`any`from(1) +} + +class D { + ~any~fun from(vararg a : Any){} + ~str~fun from(vararg a : String){} +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java b/compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java index 84d8b82c38c..aacc2ca0d65 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/CompileTextTest.java @@ -17,8 +17,12 @@ package org.jetbrains.jet.codegen; import org.jetbrains.jet.CompileCompilerDependenciesTest; -import org.jetbrains.jet.compiler.CompileEnvironment; +import org.jetbrains.jet.compiler.CompileEnvironmentConfiguration; +import org.jetbrains.jet.compiler.CompileEnvironmentUtil; +import org.jetbrains.jet.compiler.JetCoreEnvironment; +import org.jetbrains.jet.compiler.KotlinToJVMBytecodeCompiler; import org.jetbrains.jet.compiler.messages.MessageCollector; +import org.jetbrains.jet.lang.resolve.java.CompilerDependencies; import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode; import java.lang.reflect.InvocationTargetException; @@ -27,9 +31,11 @@ import java.lang.reflect.Method; public class CompileTextTest extends CodegenTestCase { public void testMe() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { String text = "import org.jetbrains.jet.codegen.CompileTextTest; fun x() = CompileTextTest()"; - CompileEnvironment compileEnvironment = new CompileEnvironment(MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR, CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR)); - compileEnvironment.getEnvironment().addToClasspathFromClassLoader(getClass().getClassLoader()); - ClassLoader classLoader = compileEnvironment.compileText(text); + CompilerDependencies dependencies = CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR); + JetCoreEnvironment environment = new JetCoreEnvironment(CompileEnvironmentUtil.createMockDisposable(), dependencies); + CompileEnvironmentConfiguration configuration = new CompileEnvironmentConfiguration(environment, dependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR); + configuration.getEnvironment().addToClasspathFromClassLoader(getClass().getClassLoader()); + ClassLoader classLoader = KotlinToJVMBytecodeCompiler.compileText(configuration, text); Class namespace = classLoader.loadClass("namespace"); Method x = namespace.getDeclaredMethod("x"); Object invoke = x.invoke(null); diff --git a/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java b/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java index 20f6a1892d4..6e18a9aa08c 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java @@ -17,8 +17,8 @@ package org.jetbrains.jet.codegen; import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime; -import org.jetbrains.jet.compiler.CompileEnvironment; import org.jetbrains.jet.lang.psi.JetPsiUtil; +import org.junit.Test; import java.io.File; import java.lang.annotation.*; @@ -28,8 +28,6 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; -import org.junit.Test; - /** * @author alex.tkachman */ diff --git a/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java b/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java index fd9e6ce37a3..6ffbe45126b 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java @@ -23,6 +23,7 @@ import junit.framework.TestCase; import junit.framework.TestSuite; import org.jetbrains.jet.CompileCompilerDependenciesTest; import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime; +import org.jetbrains.jet.compiler.CompileEnvironmentConfiguration; import org.jetbrains.jet.compiler.KotlinToJVMBytecodeCompiler; import org.jetbrains.jet.compiler.messages.MessageCollector; import org.jetbrains.jet.lang.descriptors.ClassDescriptor; @@ -37,7 +38,6 @@ import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.parsing.JetParsingTest; import java.io.File; -import java.io.PrintStream; import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.net.URL; @@ -75,7 +75,6 @@ public class TestlibTest extends CodegenTestCase { private TestSuite doBuildSuite() { try { - PrintStream err = System.err; CompilerDependencies compilerDependencies = CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR); File junitJar = new File("libraries/lib/junit-4.9.jar"); @@ -92,7 +91,7 @@ public class TestlibTest extends CodegenTestCase { myEnvironment.addSources(localFileSystem.findFileByPath(JetParsingTest.getTestDataDir() + "/../../libraries/kunit/src")); GenerationState generationState = KotlinToJVMBytecodeCompiler - .analyzeAndGenerate(myEnvironment, compilerDependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR, false); + .analyzeAndGenerate(new CompileEnvironmentConfiguration(myEnvironment, compilerDependencies, MessageCollector.PLAIN_TEXT_TO_SYSTEM_ERR), false); if (generationState == null) { throw new RuntimeException("There were compilation errors"); diff --git a/confluence/.idea/.name b/confluence/.idea/.name deleted file mode 100644 index 641844e16cf..00000000000 --- a/confluence/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -confluence \ No newline at end of file diff --git a/confluence/.idea/ant.xml b/confluence/.idea/ant.xml deleted file mode 100644 index dd6fe2b2026..00000000000 --- a/confluence/.idea/ant.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/confluence/.idea/compiler.xml b/confluence/.idea/compiler.xml deleted file mode 100644 index ef7bf86ef67..00000000000 --- a/confluence/.idea/compiler.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/confluence/.idea/copyright/profiles_settings.xml b/confluence/.idea/copyright/profiles_settings.xml deleted file mode 100644 index 3572571ad83..00000000000 --- a/confluence/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/confluence/.idea/encodings.xml b/confluence/.idea/encodings.xml deleted file mode 100644 index e206d70d859..00000000000 --- a/confluence/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/confluence/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml b/confluence/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml deleted file mode 100644 index 30ff5cb7910..00000000000 --- a/confluence/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__asm_asm_1_5_3.xml b/confluence/.idea/libraries/Maven__asm_asm_1_5_3.xml deleted file mode 100644 index a49e53040e1..00000000000 --- a/confluence/.idea/libraries/Maven__asm_asm_1_5_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__axis_axis_1_2_1.xml b/confluence/.idea/libraries/Maven__axis_axis_1_2_1.xml deleted file mode 100644 index 83151b16083..00000000000 --- a/confluence/.idea/libraries/Maven__axis_axis_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__axis_axis_jaxrpc_1_2_1_noqname.xml b/confluence/.idea/libraries/Maven__axis_axis_jaxrpc_1_2_1_noqname.xml deleted file mode 100644 index d11e10548a9..00000000000 --- a/confluence/.idea/libraries/Maven__axis_axis_jaxrpc_1_2_1_noqname.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__axis_axis_saaj_1_2_1.xml b/confluence/.idea/libraries/Maven__axis_axis_saaj_1_2_1.xml deleted file mode 100644 index 8bc7aecc07f..00000000000 --- a/confluence/.idea/libraries/Maven__axis_axis_saaj_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__batik_batik_all_1_6.xml b/confluence/.idea/libraries/Maven__batik_batik_all_1_6.xml deleted file mode 100644 index f975e07b255..00000000000 --- a/confluence/.idea/libraries/Maven__batik_batik_all_1_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__biz_aQute_bndlib_0_0_255.xml b/confluence/.idea/libraries/Maven__biz_aQute_bndlib_0_0_255.xml deleted file mode 100644 index b633f786b61..00000000000 --- a/confluence/.idea/libraries/Maven__biz_aQute_bndlib_0_0_255.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__c3p0_c3p0_0_9_1_2.xml b/confluence/.idea/libraries/Maven__c3p0_c3p0_0_9_1_2.xml deleted file mode 100644 index fead87ba590..00000000000 --- a/confluence/.idea/libraries/Maven__c3p0_c3p0_0_9_1_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__cglib_cglib_2_1_3.xml b/confluence/.idea/libraries/Maven__cglib_cglib_2_1_3.xml deleted file mode 100644 index 695f88a1984..00000000000 --- a/confluence/.idea/libraries/Maven__cglib_cglib_2_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_api_3_3.xml b/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_api_3_3.xml deleted file mode 100644 index bf37575377f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_api_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_host_3_3.xml b/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_host_3_3.xml deleted file mode 100644 index a3dcc7e2ba4..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_host_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_spi_3_3.xml b/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_spi_3_3.xml deleted file mode 100644 index 810155edf1d..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_applinks_applinks_spi_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_bandana_atlassian_bandana_3_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_bandana_atlassian_bandana_3_1.xml deleted file mode 100644 index e64fac4223b..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_bandana_atlassian_bandana_3_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_bonnie_atlassian_bonnie_4_0_beta3.xml b/confluence/.idea/libraries/Maven__com_atlassian_bonnie_atlassian_bonnie_4_0_beta3.xml deleted file mode 100644 index 7b1e7381588..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_bonnie_atlassian_bonnie_4_0_beta3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_api_0_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_api_0_1.xml deleted file mode 100644 index 34a2402f5ae..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_api_0_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_memory_0_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_memory_0_1.xml deleted file mode 100644 index 59d6db41a8f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_cache_atlassian_cache_memory_0_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_config_atlassian_config_0_13_2.xml b/confluence/.idea/libraries/Maven__com_atlassian_config_atlassian_config_0_13_2.xml deleted file mode 100644 index 87f5dcc00c1..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_config_atlassian_config_0_13_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_3_5_2.xml b/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_3_5_2.xml deleted file mode 100644 index f17fbf7c403..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_3_5_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_bucket_3_5_2.xml b/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_bucket_3_5_2.xml deleted file mode 100644 index 091d76bd587..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_bucket_3_5_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_upgrade_3_5_2.xml b/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_upgrade_3_5_2.xml deleted file mode 100644 index 90c0559392f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_confluence_confluence_upgrade_3_5_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_confluence_plugin_func_test_2_3.xml b/confluence/.idea/libraries/Maven__com_atlassian_confluence_plugin_func_test_2_3.xml deleted file mode 100644 index e82ab109b8c..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_confluence_plugin_func_test_2_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_core_atlassian_core_4_5_8.xml b/confluence/.idea/libraries/Maven__com_atlassian_core_atlassian_core_4_5_8.xml deleted file mode 100644 index cfd18d8d624..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_core_atlassian_core_4_5_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_atlassian_user_1_2_4.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_atlassian_user_1_2_4.xml deleted file mode 100644 index cbdf725123d..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_atlassian_user_1_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_hibernate2_1_2_4.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_hibernate2_1_2_4.xml deleted file mode 100644 index 0cd4a7b64fc..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_atlassian_embedded_crowd_hibernate2_1_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_api_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_api_2_2_5.xml deleted file mode 100644 index d8c40317dac..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_api_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_core_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_core_2_2_5.xml deleted file mode 100644 index 4aa5f018902..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_core_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_events_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_events_2_2_5.xml deleted file mode 100644 index 7664ee654d2..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_events_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_api_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_api_2_2_5.xml deleted file mode 100644 index 53ea19b4d17..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_api_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_common_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_common_2_2_5.xml deleted file mode 100644 index 529af400204..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_common_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_rest_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_rest_2_2_5.xml deleted file mode 100644 index f74a6608ca4..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_client_rest_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_seraph22_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_seraph22_2_2_5.xml deleted file mode 100644 index 360d223f6f0..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_integration_seraph22_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_ldap_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_ldap_2_2_5.xml deleted file mode 100644 index 10c2112b0c4..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_ldap_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_password_encoders_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_password_encoders_2_2_5.xml deleted file mode 100644 index 4258ca8d5d2..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_password_encoders_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_persistence_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_persistence_2_2_5.xml deleted file mode 100644 index cffb9b55852..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_persistence_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_remote_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_remote_2_2_5.xml deleted file mode 100644 index d392762cd1d..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_crowd_remote_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_api_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_api_2_2_5.xml deleted file mode 100644 index 66a0205f936..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_api_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_core_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_core_2_2_5.xml deleted file mode 100644 index c41657dc139..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_core_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_spi_2_2_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_spi_2_2_5.xml deleted file mode 100644 index 2d1162b1585..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_crowd_embedded_crowd_spi_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_event_atlassian_event_2_0_6.xml b/confluence/.idea/libraries/Maven__com_atlassian_event_atlassian_event_2_0_6.xml deleted file mode 100644 index 39f13dc6687..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_event_atlassian_event_2_0_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_extras_atlassian_extras_2_4.xml b/confluence/.idea/libraries/Maven__com_atlassian_extras_atlassian_extras_2_4.xml deleted file mode 100644 index b153e22cc07..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_extras_atlassian_extras_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_gzipfilter_atlassian_gzipfilter_1_9.xml b/confluence/.idea/libraries/Maven__com_atlassian_gzipfilter_atlassian_gzipfilter_1_9.xml deleted file mode 100644 index 31a3f7bc602..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_gzipfilter_atlassian_gzipfilter_1_9.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_jdk_utilities_atlassian_jdk_utilities_0_4.xml b/confluence/.idea/libraries/Maven__com_atlassian_jdk_utilities_atlassian_jdk_utilities_0_4.xml deleted file mode 100644 index 96ceaa2d0f7..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_jdk_utilities_atlassian_jdk_utilities_0_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_johnson_atlassian_johnson_0_10.xml b/confluence/.idea/libraries/Maven__com_atlassian_johnson_atlassian_johnson_0_10.xml deleted file mode 100644 index 7788d1bb35a..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_johnson_atlassian_johnson_0_10.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_mail_atlassian_mail_1_16.xml b/confluence/.idea/libraries/Maven__com_atlassian_mail_atlassian_mail_1_16.xml deleted file mode 100644 index d9cf6de183d..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_mail_atlassian_mail_1_16.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_modzdetector_modz_detector_0_8.xml b/confluence/.idea/libraries/Maven__com_atlassian_modzdetector_modz_detector_0_8.xml deleted file mode 100644 index 1df9d471489..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_modzdetector_modz_detector_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_multitenant_multitenant_core_1_0_m14.xml b/confluence/.idea/libraries/Maven__com_atlassian_multitenant_multitenant_core_1_0_m14.xml deleted file mode 100644 index 1cd3f72458a..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_multitenant_multitenant_core_1_0_m14.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_paddle_atlassian_paddle_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_paddle_atlassian_paddle_5.xml deleted file mode 100644 index 8245219467b..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_paddle_atlassian_paddle_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_core_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_core_2_7_5.xml deleted file mode 100644 index 1546384ac29..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_core_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_2_7_5.xml deleted file mode 100644 index 9f2804ae12f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_events_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_events_2_7_5.xml deleted file mode 100644 index 41a92f72ce7..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_osgi_events_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_servlet_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_servlet_2_7_5.xml deleted file mode 100644 index 18629e0ff64..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_servlet_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_spring_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_spring_2_7_5.xml deleted file mode 100644 index 54bf42682d7..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_spring_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webfragment_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webfragment_2_7_5.xml deleted file mode 100644 index fee47bcd0ca..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webfragment_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webresource_2_7_5.xml b/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webresource_2_7_5.xml deleted file mode 100644 index 2ba848a77c9..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_plugins_atlassian_plugins_webresource_2_7_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_profiling_atlassian_profiling_1_8_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_profiling_atlassian_profiling_1_8_1.xml deleted file mode 100644 index b216e4057ec..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_profiling_atlassian_profiling_1_8_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_renderer_atlassian_renderer_7_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_renderer_atlassian_renderer_7_0.xml deleted file mode 100644 index a8ba7383f37..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_renderer_atlassian_renderer_7_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_api_2_4_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_api_2_4_1.xml deleted file mode 100644 index 8d0011156b3..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_api_2_4_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spi_2_4_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spi_2_4_1.xml deleted file mode 100644 index 279daafd63f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spi_2_4_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spring_2_4_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spring_2_4_1.xml deleted file mode 100644 index e3e2ba59db0..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_sal_sal_spring_2_4_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_cookie_tools_2_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_cookie_tools_2_0.xml deleted file mode 100644 index 70325f6137b..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_cookie_tools_2_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_password_encoder_1_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_password_encoder_1_0.xml deleted file mode 100644 index aa41220ed4f..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_password_encoder_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_secure_random_1_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_secure_random_1_0.xml deleted file mode 100644 index 6d2cc1eae20..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_atlassian_secure_random_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_core_2_3_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_core_2_3_1.xml deleted file mode 100644 index 1ec036ac7b1..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_core_2_3_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_seraph_integration_2_3_1.xml b/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_seraph_integration_2_3_1.xml deleted file mode 100644 index c91f8761cab..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_security_auth_trustedapps_atlassian_trusted_apps_seraph_integration_2_3_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_seraph_atlassian_seraph_2_4_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_seraph_atlassian_seraph_2_4_0.xml deleted file mode 100644 index 40a4bab2067..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_seraph_atlassian_seraph_2_4_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_2_0_rc4.xml b/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_2_0_rc4.xml deleted file mode 100644 index 8003ee74811..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_2_0_rc4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_hibernate2_2_0_rc4.xml b/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_hibernate2_2_0_rc4.xml deleted file mode 100644 index 36f4ed56d38..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_spring_atlassian_spring_hibernate2_2_0_rc4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_trackback_atlassian_trackback_0_10.xml b/confluence/.idea/libraries/Maven__com_atlassian_trackback_atlassian_trackback_0_10.xml deleted file mode 100644 index f352cd0ecb5..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_trackback_atlassian_trackback_0_10.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_user_atlassian_user_3_0.xml b/confluence/.idea/libraries/Maven__com_atlassian_user_atlassian_user_3_0.xml deleted file mode 100644 index 3cb142dc08c..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_user_atlassian_user_3_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_util_concurrent_atlassian_util_concurrent_0_0_12.xml b/confluence/.idea/libraries/Maven__com_atlassian_util_concurrent_atlassian_util_concurrent_0_0_12.xml deleted file mode 100644 index 925d72941f6..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_util_concurrent_atlassian_util_concurrent_0_0_12.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_velocity_atlassian_velocity_0_7.xml b/confluence/.idea/libraries/Maven__com_atlassian_velocity_atlassian_velocity_0_7.xml deleted file mode 100644 index d27f0335686..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_velocity_atlassian_velocity_0_7.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_10_1_12.xml b/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_10_1_12.xml deleted file mode 100644 index c431c7acdb4..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_10_1_12.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_core_1_12.xml b/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_core_1_12.xml deleted file mode 100644 index f219928f738..00000000000 --- a/confluence/.idea/libraries/Maven__com_atlassian_xwork_atlassian_xwork_core_1_12.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_google_collections_google_collections_1_0.xml b/confluence/.idea/libraries/Maven__com_google_collections_google_collections_1_0.xml deleted file mode 100644 index 7ed5d20e2d4..00000000000 --- a/confluence/.idea/libraries/Maven__com_google_collections_google_collections_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_ibm_icu_icu4j_3_8.xml b/confluence/.idea/libraries/Maven__com_ibm_icu_icu4j_3_8.xml deleted file mode 100644 index 0114a3f52a8..00000000000 --- a/confluence/.idea/libraries/Maven__com_ibm_icu_icu4j_3_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_octo_captcha_jcaptcha_all_1_0_RC6.xml b/confluence/.idea/libraries/Maven__com_octo_captcha_jcaptcha_all_1_0_RC6.xml deleted file mode 100644 index 3fffc2c735a..00000000000 --- a/confluence/.idea/libraries/Maven__com_octo_captcha_jcaptcha_all_1_0_RC6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_sun_jai_codec_1_1_3.xml b/confluence/.idea/libraries/Maven__com_sun_jai_codec_1_1_3.xml deleted file mode 100644 index 4321ce3251d..00000000000 --- a/confluence/.idea/libraries/Maven__com_sun_jai_codec_1_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_sun_jai_core_1_1_3.xml b/confluence/.idea/libraries/Maven__com_sun_jai_core_1_1_3.xml deleted file mode 100644 index a998f2fe81f..00000000000 --- a/confluence/.idea/libraries/Maven__com_sun_jai_core_1_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_1_1.xml b/confluence/.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_1_1.xml deleted file mode 100644 index 71b652fb682..00000000000 --- a/confluence/.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_6_1.xml b/confluence/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_6_1.xml deleted file mode 100644 index 6eeab12ce6d..00000000000 --- a/confluence/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_6_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_codec_commons_codec_1_4.xml b/confluence/.idea/libraries/Maven__commons_codec_commons_codec_1_4.xml deleted file mode 100644 index 2b149c4de28..00000000000 --- a/confluence/.idea/libraries/Maven__commons_codec_commons_codec_1_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_collections_commons_collections_3_2.xml b/confluence/.idea/libraries/Maven__commons_collections_commons_collections_3_2.xml deleted file mode 100644 index 73b28f310bf..00000000000 --- a/confluence/.idea/libraries/Maven__commons_collections_commons_collections_3_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_digester_commons_digester_1_5.xml b/confluence/.idea/libraries/Maven__commons_digester_commons_digester_1_5.xml deleted file mode 100644 index 4a947b08dc1..00000000000 --- a/confluence/.idea/libraries/Maven__commons_digester_commons_digester_1_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_discovery_commons_discovery_0_2.xml b/confluence/.idea/libraries/Maven__commons_discovery_commons_discovery_0_2.xml deleted file mode 100644 index 5c97345cafe..00000000000 --- a/confluence/.idea/libraries/Maven__commons_discovery_commons_discovery_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_1.xml b/confluence/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_1.xml deleted file mode 100644 index e59b3ef50cb..00000000000 --- a/confluence/.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_httpclient_commons_httpclient_3_0.xml b/confluence/.idea/libraries/Maven__commons_httpclient_commons_httpclient_3_0.xml deleted file mode 100644 index cc22b931de6..00000000000 --- a/confluence/.idea/libraries/Maven__commons_httpclient_commons_httpclient_3_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_io_commons_io_1_4.xml b/confluence/.idea/libraries/Maven__commons_io_commons_io_1_4.xml deleted file mode 100644 index 054eda88eed..00000000000 --- a/confluence/.idea/libraries/Maven__commons_io_commons_io_1_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_jrcs_commons_jrcs_diff_0_1_7.xml b/confluence/.idea/libraries/Maven__commons_jrcs_commons_jrcs_diff_0_1_7.xml deleted file mode 100644 index a16dd40f37b..00000000000 --- a/confluence/.idea/libraries/Maven__commons_jrcs_commons_jrcs_diff_0_1_7.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_lang_commons_lang_2_4.xml b/confluence/.idea/libraries/Maven__commons_lang_commons_lang_2_4.xml deleted file mode 100644 index 5e8b8d3352e..00000000000 --- a/confluence/.idea/libraries/Maven__commons_lang_commons_lang_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml b/confluence/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml deleted file mode 100644 index b770f56aa97..00000000000 --- a/confluence/.idea/libraries/Maven__commons_logging_commons_logging_1_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__concurrent_concurrent_1_3_4.xml b/confluence/.idea/libraries/Maven__concurrent_concurrent_1_3_4.xml deleted file mode 100644 index 4acbd2f600b..00000000000 --- a/confluence/.idea/libraries/Maven__concurrent_concurrent_1_3_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__dom4j_dom4j_1_4_full.xml b/confluence/.idea/libraries/Maven__dom4j_dom4j_1_4_full.xml deleted file mode 100644 index 8fdc45e28b5..00000000000 --- a/confluence/.idea/libraries/Maven__dom4j_dom4j_1_4_full.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__exml_exml_7_1.xml b/confluence/.idea/libraries/Maven__exml_exml_7_1.xml deleted file mode 100644 index ec25f4e832e..00000000000 --- a/confluence/.idea/libraries/Maven__exml_exml_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__glue_glue_5_0b2.xml b/confluence/.idea/libraries/Maven__glue_glue_5_0b2.xml deleted file mode 100644 index ceb3b310327..00000000000 --- a/confluence/.idea/libraries/Maven__glue_glue_5_0b2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__hibernate_hibernate_2_1_8_atlassian_9.xml b/confluence/.idea/libraries/Maven__hibernate_hibernate_2_1_8_atlassian_9.xml deleted file mode 100644 index 86441b1755a..00000000000 --- a/confluence/.idea/libraries/Maven__hibernate_hibernate_2_1_8_atlassian_9.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_activation_activation_1_0_2.xml b/confluence/.idea/libraries/Maven__javax_activation_activation_1_0_2.xml deleted file mode 100644 index f453d9b23f6..00000000000 --- a/confluence/.idea/libraries/Maven__javax_activation_activation_1_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_mail_mail_1_4_1.xml b/confluence/.idea/libraries/Maven__javax_mail_mail_1_4_1.xml deleted file mode 100644 index 2c155f3a1fb..00000000000 --- a/confluence/.idea/libraries/Maven__javax_mail_mail_1_4_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_servlet_servlet_api_2_4.xml b/confluence/.idea/libraries/Maven__javax_servlet_servlet_api_2_4.xml deleted file mode 100644 index eb1ede25488..00000000000 --- a/confluence/.idea/libraries/Maven__javax_servlet_servlet_api_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_transaction_jta_1_0_1B.xml b/confluence/.idea/libraries/Maven__javax_transaction_jta_1_0_1B.xml deleted file mode 100644 index 391fe350a14..00000000000 --- a/confluence/.idea/libraries/Maven__javax_transaction_jta_1_0_1B.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml b/confluence/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml deleted file mode 100644 index 2a4dd7a2e50..00000000000 --- a/confluence/.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__jdom_jdom_1_0.xml b/confluence/.idea/libraries/Maven__jdom_jdom_1_0.xml deleted file mode 100644 index 3349d675fba..00000000000 --- a/confluence/.idea/libraries/Maven__jdom_jdom_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__jfree_jcommon_1_0_0.xml b/confluence/.idea/libraries/Maven__jfree_jcommon_1_0_0.xml deleted file mode 100644 index 733dc3fcb8d..00000000000 --- a/confluence/.idea/libraries/Maven__jfree_jcommon_1_0_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__jfree_jfreechart_1_0_0.xml b/confluence/.idea/libraries/Maven__jfree_jfreechart_1_0_0.xml deleted file mode 100644 index 4654abe6fd5..00000000000 --- a/confluence/.idea/libraries/Maven__jfree_jfreechart_1_0_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__joda_time_joda_time_1_6.xml b/confluence/.idea/libraries/Maven__joda_time_joda_time_1_6.xml deleted file mode 100644 index a6fe1789647..00000000000 --- a/confluence/.idea/libraries/Maven__joda_time_joda_time_1_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__junit_junit_4_6.xml b/confluence/.idea/libraries/Maven__junit_junit_4_6.xml deleted file mode 100644 index 07e29e2f84c..00000000000 --- a/confluence/.idea/libraries/Maven__junit_junit_4_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__log4j_log4j_1_2_15.xml b/confluence/.idea/libraries/Maven__log4j_log4j_1_2_15.xml deleted file mode 100644 index c6024af8c41..00000000000 --- a/confluence/.idea/libraries/Maven__log4j_log4j_1_2_15.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__mockobjects_alt_jdk1_3_0_07.xml b/confluence/.idea/libraries/Maven__mockobjects_alt_jdk1_3_0_07.xml deleted file mode 100644 index a56dde5b819..00000000000 --- a/confluence/.idea/libraries/Maven__mockobjects_alt_jdk1_3_0_07.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__mockobjects_mockobjects_alt_jdk1_3_j2ee1_3_0_09.xml b/confluence/.idea/libraries/Maven__mockobjects_mockobjects_alt_jdk1_3_j2ee1_3_0_09.xml deleted file mode 100644 index 2ccb999080b..00000000000 --- a/confluence/.idea/libraries/Maven__mockobjects_mockobjects_alt_jdk1_3_j2ee1_3_0_09.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_java_dev_stax_utils_stax_utils_20040917.xml b/confluence/.idea/libraries/Maven__net_java_dev_stax_utils_stax_utils_20040917.xml deleted file mode 100644 index f0e2ad5477a..00000000000 --- a/confluence/.idea/libraries/Maven__net_java_dev_stax_utils_stax_utils_20040917.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_java_dev_urlrewrite_urlrewrite_2_6_0.xml b/confluence/.idea/libraries/Maven__net_java_dev_urlrewrite_urlrewrite_2_6_0.xml deleted file mode 100644 index 1448e838ad1..00000000000 --- a/confluence/.idea/libraries/Maven__net_java_dev_urlrewrite_urlrewrite_2_6_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_jcip_jcip_annotations_1_0.xml b/confluence/.idea/libraries/Maven__net_jcip_jcip_annotations_1_0.xml deleted file mode 100644 index d29c82f6b50..00000000000 --- a/confluence/.idea/libraries/Maven__net_jcip_jcip_annotations_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sf_ehcache_ehcache_1_2_3.xml b/confluence/.idea/libraries/Maven__net_sf_ehcache_ehcache_1_2_3.xml deleted file mode 100644 index cf5103197c9..00000000000 --- a/confluence/.idea/libraries/Maven__net_sf_ehcache_ehcache_1_2_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sf_ldaptemplate_ldaptemplate_1_0_1.xml b/confluence/.idea/libraries/Maven__net_sf_ldaptemplate_ldaptemplate_1_0_1.xml deleted file mode 100644 index a2c0de98286..00000000000 --- a/confluence/.idea/libraries/Maven__net_sf_ldaptemplate_ldaptemplate_1_0_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_cssparser_cssparser_0_9_5.xml b/confluence/.idea/libraries/Maven__net_sourceforge_cssparser_cssparser_0_9_5.xml deleted file mode 100644 index 8507f2ff7a5..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_cssparser_cssparser_0_9_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_2_5.xml b/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_2_5.xml deleted file mode 100644 index d048fd28e28..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_core_js_2_5.xml b/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_core_js_2_5.xml deleted file mode 100644 index 82aa83f6c78..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_htmlunit_htmlunit_core_js_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_core_2_2.xml b/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_core_2_2.xml deleted file mode 100644 index acecc6cc5e9..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_core_2_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_htmlunit_plugin_2_2.xml b/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_htmlunit_plugin_2_2.xml deleted file mode 100644 index 0e1015a0711..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_jwebunit_jwebunit_htmlunit_plugin_2_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__net_sourceforge_nekohtml_nekohtml_1_9_12.xml b/confluence/.idea/libraries/Maven__net_sourceforge_nekohtml_nekohtml_1_9_12.xml deleted file mode 100644 index 33a21fc9d4e..00000000000 --- a/confluence/.idea/libraries/Maven__net_sourceforge_nekohtml_nekohtml_1_9_12.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__odmg_odmg_3_0.xml b/confluence/.idea/libraries/Maven__odmg_odmg_3_0.xml deleted file mode 100644 index a7d4eb22a47..00000000000 --- a/confluence/.idea/libraries/Maven__odmg_odmg_3_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__ognl_ognl_2_6_5_atlassian_2.xml b/confluence/.idea/libraries/Maven__ognl_ognl_2_6_5_atlassian_2.xml deleted file mode 100644 index 9a80fd09d55..00000000000 --- a/confluence/.idea/libraries/Maven__ognl_ognl_2_6_5_atlassian_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_oscore_2_2_7_atlassian_1.xml b/confluence/.idea/libraries/Maven__opensymphony_oscore_2_2_7_atlassian_1.xml deleted file mode 100644 index c5425dc436c..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_oscore_2_2_7_atlassian_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_propertyset_1_3_21Nov03.xml b/confluence/.idea/libraries/Maven__opensymphony_propertyset_1_3_21Nov03.xml deleted file mode 100644 index 86a7bea7d32..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_propertyset_1_3_21Nov03.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_sitemesh_2_3_atlassian.xml b/confluence/.idea/libraries/Maven__opensymphony_sitemesh_2_3_atlassian.xml deleted file mode 100644 index 7fbff89fba9..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_sitemesh_2_3_atlassian.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_webwork_2_1_5_atlassian_2.xml b/confluence/.idea/libraries/Maven__opensymphony_webwork_2_1_5_atlassian_2.xml deleted file mode 100644 index 0e1be0423d2..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_webwork_2_1_5_atlassian_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__opensymphony_xwork_1_0_3_2.xml b/confluence/.idea/libraries/Maven__opensymphony_xwork_1_0_3_2.xml deleted file mode 100644 index a298796d89c..00000000000 --- a/confluence/.idea/libraries/Maven__opensymphony_xwork_1_0_3_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_felix_org_apache_felix_framework_3_0_2.xml b/confluence/.idea/libraries/Maven__org_apache_felix_org_apache_felix_framework_3_0_2.xml deleted file mode 100644 index 35187e5a7b1..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_felix_org_apache_felix_framework_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_analyzers_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_analyzers_2_9_4.xml deleted file mode 100644 index 2a5bcd5cf3f..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_analyzers_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_core_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_core_2_9_4.xml deleted file mode 100644 index 363169fa2a7..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_core_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_highlighter_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_highlighter_2_9_4.xml deleted file mode 100644 index 9e0a268aecd..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_highlighter_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_memory_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_memory_2_9_4.xml deleted file mode 100644 index def13b2aacb..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_memory_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_misc_2_9_4.xml b/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_misc_2_9_4.xml deleted file mode 100644 index 1cbb369e41f..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_lucene_lucene_misc_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_pdfbox_fontbox_1_2_1.xml b/confluence/.idea/libraries/Maven__org_apache_pdfbox_fontbox_1_2_1.xml deleted file mode 100644 index d933e74a706..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_pdfbox_fontbox_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_pdfbox_jempbox_1_2_1.xml b/confluence/.idea/libraries/Maven__org_apache_pdfbox_jempbox_1_2_1.xml deleted file mode 100644 index 84402967e7c..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_pdfbox_jempbox_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_pdfbox_pdfbox_1_2_1.xml b/confluence/.idea/libraries/Maven__org_apache_pdfbox_pdfbox_1_2_1.xml deleted file mode 100644 index 52eabfa6d7c..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_pdfbox_pdfbox_1_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_poi_poi_3_5_FINAL.xml b/confluence/.idea/libraries/Maven__org_apache_poi_poi_3_5_FINAL.xml deleted file mode 100644 index 2d22ab1c178..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_poi_poi_3_5_FINAL.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_poi_poi_scratchpad_3_5_FINAL.xml b/confluence/.idea/libraries/Maven__org_apache_poi_poi_scratchpad_3_5_FINAL.xml deleted file mode 100644 index 947dd72cbd8..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_poi_poi_scratchpad_3_5_FINAL.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_velocity_velocity_1_6_1_atlassian_2.xml b/confluence/.idea/libraries/Maven__org_apache_velocity_velocity_1_6_1_atlassian_2.xml deleted file mode 100644 index 2aa6e213d2c..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_velocity_velocity_1_6_1_atlassian_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_apache_ws_commons_XmlSchema_1_1.xml b/confluence/.idea/libraries/Maven__org_apache_ws_commons_XmlSchema_1_1.xml deleted file mode 100644 index 6b5c280edec..00000000000 --- a/confluence/.idea/libraries/Maven__org_apache_ws_commons_XmlSchema_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_6_0.xml b/confluence/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_6_0.xml deleted file mode 100644 index e16d50af933..00000000000 --- a/confluence/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_6_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_bouncycastle_bcmail_jdk15_1_44.xml b/confluence/.idea/libraries/Maven__org_bouncycastle_bcmail_jdk15_1_44.xml deleted file mode 100644 index cb97b14d799..00000000000 --- a/confluence/.idea/libraries/Maven__org_bouncycastle_bcmail_jdk15_1_44.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15_1_44.xml b/confluence/.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15_1_44.xml deleted file mode 100644 index 8f000654d01..00000000000 --- a/confluence/.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15_1_44.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_codehaus_woodstox_wstx_asl_3_2_4.xml b/confluence/.idea/libraries/Maven__org_codehaus_woodstox_wstx_asl_3_2_4.xml deleted file mode 100644 index 1f1ad72371f..00000000000 --- a/confluence/.idea/libraries/Maven__org_codehaus_woodstox_wstx_asl_3_2_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_aegis_1_2_6.xml b/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_aegis_1_2_6.xml deleted file mode 100644 index 8d9f879fdbe..00000000000 --- a/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_aegis_1_2_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_core_1_2_6.xml b/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_core_1_2_6.xml deleted file mode 100644 index c3ded8bb4e9..00000000000 --- a/confluence/.idea/libraries/Maven__org_codehaus_xfire_xfire_core_1_2_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_directwebremoting_dwr_2_0_3.xml b/confluence/.idea/libraries/Maven__org_directwebremoting_dwr_2_0_3.xml deleted file mode 100644 index d45d92ae360..00000000000 --- a/confluence/.idea/libraries/Maven__org_directwebremoting_dwr_2_0_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_hibernate_jtidy_r8_20060801.xml b/confluence/.idea/libraries/Maven__org_hibernate_jtidy_r8_20060801.xml deleted file mode 100644 index 028d1c29400..00000000000 --- a/confluence/.idea/libraries/Maven__org_hibernate_jtidy_r8_20060801.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_hsqldb_hsqldb_2_0_1_rc3_20110120.xml b/confluence/.idea/libraries/Maven__org_hsqldb_hsqldb_2_0_1_rc3_20110120.xml deleted file mode 100644 index 95d8490ecc5..00000000000 --- a/confluence/.idea/libraries/Maven__org_hsqldb_hsqldb_2_0_1_rc3_20110120.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_quartz_scheduler_quartz_1_8_0.xml b/confluence/.idea/libraries/Maven__org_quartz_scheduler_quartz_1_8_0.xml deleted file mode 100644 index 6422eb2e1dc..00000000000 --- a/confluence/.idea/libraries/Maven__org_quartz_scheduler_quartz_1_8_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_5_8.xml b/confluence/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_5_8.xml deleted file mode 100644 index 7ca6a1766ba..00000000000 --- a/confluence/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_5_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml b/confluence/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml deleted file mode 100644 index 0ea470ab5b1..00000000000 --- a/confluence/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml b/confluence/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml deleted file mode 100644 index f4725a3b778..00000000000 --- a/confluence/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_ldap_spring_ldap_core_1_3_0_RELEASE.xml b/confluence/.idea/libraries/Maven__org_springframework_ldap_spring_ldap_core_1_3_0_RELEASE.xml deleted file mode 100644 index 65e4636d24e..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_ldap_spring_ldap_core_1_3_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_security_spring_security_core_2_0_4.xml b/confluence/.idea/libraries/Maven__org_springframework_security_spring_security_core_2_0_4.xml deleted file mode 100644 index 45c36e70cdd..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_security_spring_security_core_2_0_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_aop_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_aop_2_0_8.xml deleted file mode 100644 index 89af56e4970..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_aop_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_beans_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_beans_2_0_8.xml deleted file mode 100644 index 18d4c2d1a4d..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_beans_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_context_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_context_2_0_8.xml deleted file mode 100644 index 87d78470b5c..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_context_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_core_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_core_2_0_8.xml deleted file mode 100644 index d5a5a6f81e5..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_core_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_dao_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_dao_2_0_8.xml deleted file mode 100644 index 776aeb1154f..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_dao_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_hibernate2_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_hibernate2_2_0_8.xml deleted file mode 100644 index 57208898cb7..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_hibernate2_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_jdbc_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_jdbc_2_0_8.xml deleted file mode 100644 index 92ca83b798b..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_jdbc_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_jmx_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_jmx_2_0_8.xml deleted file mode 100644 index 0815200a9c3..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_jmx_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_support_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_support_2_0_8.xml deleted file mode 100644 index ffcdcd9e117..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_support_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_springframework_spring_web_2_0_8.xml b/confluence/.idea/libraries/Maven__org_springframework_spring_web_2_0_8.xml deleted file mode 100644 index efc445d2e4b..00000000000 --- a/confluence/.idea/libraries/Maven__org_springframework_spring_web_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_twdata_pkgscanner_package_scanner_0_9_5.xml b/confluence/.idea/libraries/Maven__org_twdata_pkgscanner_package_scanner_0_9_5.xml deleted file mode 100644 index 80467858203..00000000000 --- a/confluence/.idea/libraries/Maven__org_twdata_pkgscanner_package_scanner_0_9_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__org_w3c_css_sac_1_3.xml b/confluence/.idea/libraries/Maven__org_w3c_css_sac_1_3.xml deleted file mode 100644 index af3d414615d..00000000000 --- a/confluence/.idea/libraries/Maven__org_w3c_css_sac_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__oro_oro_2_0_8.xml b/confluence/.idea/libraries/Maven__oro_oro_2_0_8.xml deleted file mode 100644 index 25203a04f0f..00000000000 --- a/confluence/.idea/libraries/Maven__oro_oro_2_0_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__oscache_oscache_2_2.xml b/confluence/.idea/libraries/Maven__oscache_oscache_2_2.xml deleted file mode 100644 index 12991d7e7e4..00000000000 --- a/confluence/.idea/libraries/Maven__oscache_oscache_2_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__osuser_osuser_atl_user.xml b/confluence/.idea/libraries/Maven__osuser_osuser_atl_user.xml deleted file mode 100644 index 23332027435..00000000000 --- a/confluence/.idea/libraries/Maven__osuser_osuser_atl_user.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__radeox_radeox_1_0b2_forked_22Apr2004.xml b/confluence/.idea/libraries/Maven__radeox_radeox_1_0b2_forked_22Apr2004.xml deleted file mode 100644 index 1106eb96510..00000000000 --- a/confluence/.idea/libraries/Maven__radeox_radeox_1_0b2_forked_22Apr2004.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__regexp_regexp_1_3.xml b/confluence/.idea/libraries/Maven__regexp_regexp_1_3.xml deleted file mode 100644 index cdc06b6bc25..00000000000 --- a/confluence/.idea/libraries/Maven__regexp_regexp_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__rome_rome_1_0.xml b/confluence/.idea/libraries/Maven__rome_rome_1_0.xml deleted file mode 100644 index ca0e345b951..00000000000 --- a/confluence/.idea/libraries/Maven__rome_rome_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__slide_slide_2_1.xml b/confluence/.idea/libraries/Maven__slide_slide_2_1.xml deleted file mode 100644 index be3fddd5c9a..00000000000 --- a/confluence/.idea/libraries/Maven__slide_slide_2_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__velocity_tools_velocity_tools_view_1_1.xml b/confluence/.idea/libraries/Maven__velocity_tools_velocity_tools_view_1_1.xml deleted file mode 100644 index c61c8f94c7b..00000000000 --- a/confluence/.idea/libraries/Maven__velocity_tools_velocity_tools_view_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__wsdl4j_wsdl4j_1_5_1.xml b/confluence/.idea/libraries/Maven__wsdl4j_wsdl4j_1_5_1.xml deleted file mode 100644 index 24358f07910..00000000000 --- a/confluence/.idea/libraries/Maven__wsdl4j_wsdl4j_1_5_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__xalan_xalan_2_7_0.xml b/confluence/.idea/libraries/Maven__xalan_xalan_2_7_0.xml deleted file mode 100644 index dd647b424bd..00000000000 --- a/confluence/.idea/libraries/Maven__xalan_xalan_2_7_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__xerces_xercesImpl_2_9_1.xml b/confluence/.idea/libraries/Maven__xerces_xercesImpl_2_9_1.xml deleted file mode 100644 index 19d39dba853..00000000000 --- a/confluence/.idea/libraries/Maven__xerces_xercesImpl_2_9_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__xmlrpc_xmlrpc_2_0_xmlrpc61_1_sbfix.xml b/confluence/.idea/libraries/Maven__xmlrpc_xmlrpc_2_0_xmlrpc61_1_sbfix.xml deleted file mode 100644 index ad2bb2b85a1..00000000000 --- a/confluence/.idea/libraries/Maven__xmlrpc_xmlrpc_2_0_xmlrpc61_1_sbfix.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/libraries/Maven__xpp3_xpp3_min_1_1_3_4_O.xml b/confluence/.idea/libraries/Maven__xpp3_xpp3_min_1_1_3_4_O.xml deleted file mode 100644 index 4cc7a5ed4a6..00000000000 --- a/confluence/.idea/libraries/Maven__xpp3_xpp3_min_1_1_3_4_O.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/.idea/misc.xml b/confluence/.idea/misc.xml deleted file mode 100644 index aed7c788205..00000000000 --- a/confluence/.idea/misc.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - http://www.w3.org/1999/xhtml - - - - - - - - - - - 1.6 - - - - - - - - - diff --git a/confluence/.idea/modules.xml b/confluence/.idea/modules.xml deleted file mode 100644 index e570ef2b587..00000000000 --- a/confluence/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/confluence/.idea/scopes/scope_settings.xml b/confluence/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b8433..00000000000 --- a/confluence/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/confluence/.idea/uiDesigner.xml b/confluence/.idea/uiDesigner.xml deleted file mode 100644 index 3b000203088..00000000000 --- a/confluence/.idea/uiDesigner.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/confluence/.idea/vcs.xml b/confluence/.idea/vcs.xml deleted file mode 100644 index 21cbaa607b2..00000000000 --- a/confluence/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/confluence/buildConfluenceLexer.xml b/confluence/buildConfluenceLexer.xml deleted file mode 100644 index e0f993ff491..00000000000 --- a/confluence/buildConfluenceLexer.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/confluence/confluence.iml b/confluence/confluence.iml deleted file mode 100644 index ab4a8b1a4e5..00000000000 --- a/confluence/confluence.iml +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/confluence/pom.xml b/confluence/pom.xml deleted file mode 100644 index b3712802bcb..00000000000 --- a/confluence/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - 4.0.0 - org.jetbrains.jet - confluence - 1.0 - - - JetBrains - http://www.jetbrains.com/ - - - confluence - Confluence support for Kotlin language. - atlassian-plugin - - - - junit - junit - 4.6 - test - - - com.atlassian.confluence - confluence - ${confluence.version} - provided - - - com.atlassian.confluence.plugin - func-test - 2.3 - test - - - net.sourceforge.jwebunit - jwebunit-htmlunit-plugin - 2.2 - test - - - net.sourceforge.nekohtml - nekohtml - 1.9.12 - test - - - - - - - com.atlassian.maven.plugins - maven-confluence-plugin - 3.3.4 - true - - ${confluence.version} - ${confluence.data.version} - - - - maven-compiler-plugin - - 1.6 - 1.6 - - - - - - - 3.5.2 - 3.5 - - - diff --git a/confluence/src/main/java/com/intellij/psi/TokenType.java b/confluence/src/main/java/com/intellij/psi/TokenType.java deleted file mode 100644 index a596523ae06..00000000000 --- a/confluence/src/main/java/com/intellij/psi/TokenType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.intellij.psi; - -import com.intellij.psi.tree.IElementType; - -/** - * @author abreslav - */ -public class TokenType { - public static final IElementType WHITE_SPACE = new IElementType(); - public static final IElementType BAD_CHARACTER = new IElementType(); -} diff --git a/confluence/src/main/java/com/intellij/psi/tree/IElementType.java b/confluence/src/main/java/com/intellij/psi/tree/IElementType.java deleted file mode 100644 index 58b6394c1ca..00000000000 --- a/confluence/src/main/java/com/intellij/psi/tree/IElementType.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.intellij.psi.tree; - -/** - * @author abreslav - */ -public class IElementType { -} diff --git a/confluence/src/main/java/com/intellij/util/text/CharArrayUtil.java b/confluence/src/main/java/com/intellij/util/text/CharArrayUtil.java deleted file mode 100644 index 8ca35f60f0a..00000000000 --- a/confluence/src/main/java/com/intellij/util/text/CharArrayUtil.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.intellij.util.text; - -/** - * @author abreslav - */ -public class CharArrayUtil { - public static char[] fromSequenceWithoutCopying(CharSequence buffer) { - char[] result = new char[buffer.length()]; - for (int i = 0; i < result.length; i++) { - result[i] = buffer.charAt(i); - } - return result; - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/FlexLexer.java b/confluence/src/main/java/org/jetbrains/jet/lexer/FlexLexer.java deleted file mode 100644 index eb004632a02..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/FlexLexer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lexer; - -/** - * @author abreslav - */ -public interface FlexLexer { -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetHTMLMacro.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetHTMLMacro.java deleted file mode 100644 index ab4f6110494..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetHTMLMacro.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lexer; - -import com.atlassian.renderer.RenderContext; -import com.atlassian.renderer.v2.RenderMode; -import com.atlassian.renderer.v2.macro.BaseMacro; -import com.atlassian.renderer.v2.macro.MacroException; - -import java.util.Map; - -/** - * @author abreslav - */ -public class JetHTMLMacro extends BaseMacro { - - @Override - public boolean hasBody() { - return true; - } - - @Override - public RenderMode getBodyRenderMode() { - return RenderMode.allow(0); - } - - @Override - public String execute(Map map, String code, RenderContext renderContext) throws MacroException { - return code; - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetKeywordToken.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetKeywordToken.java deleted file mode 100644 index f27d78b3351..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetKeywordToken.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * @author max - */ -package org.jetbrains.jet.lexer; - - -public class JetKeywordToken extends JetToken { - - public static JetKeywordToken keyword(String value) { - return new JetKeywordToken(value, false); - } - - public static JetKeywordToken softKeyword(String value) { - return new JetKeywordToken(value, true); - } - - private final String myValue; - private final boolean myIsSoft; - - private JetKeywordToken(String value, boolean isSoft) { - super(value); - myValue = value; - myIsSoft = isSoft; - } - - public String getValue() { - return myValue; - } - - public boolean isSoft() { - return myIsSoft; - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java deleted file mode 100644 index 794cb243b1b..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetMacro.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lexer; - -import com.atlassian.confluence.renderer.radeox.macros.MacroUtils; -import com.atlassian.confluence.util.velocity.VelocityUtils; -import com.atlassian.renderer.RenderContext; -import com.atlassian.renderer.v2.RenderMode; -import com.atlassian.renderer.v2.macro.BaseMacro; -import com.atlassian.renderer.v2.macro.MacroException; -import com.intellij.psi.TokenType; -import com.intellij.psi.tree.IElementType; -import org.apache.velocity.VelocityContext; - -import java.io.StringReader; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * @author abreslav - */ -public class JetMacro extends BaseMacro { - - public static final StringReader DUMMY_READER = new StringReader(""); - - private static class TagData { - final TagType type; - final String message; - final int start; - final boolean nextToken; - int end; - - TagData(TagType type, String message, int start, boolean nextToken) { - this.type = type; - this.message = message; - this.start = start; - this.nextToken = nextToken; - } - } - - private static abstract class TagType { - public final String tagName; - - private TagType(String tagName) { - this.tagName = tagName; - } - - public abstract void appendOpenTag(StringBuilder builder, TagData tagData); - public abstract void appendCloseTag(StringBuilder builder, TagData tagData); - - @Override - public String toString() { - return tagName; - } - } - - private static class StyledDivTagType extends TagType { - - private StyledDivTagType(String tagName) { - super(tagName); - } - - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - assert tagData.type == this; - builder.append("
"); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - } - - private static final TagType[] knownExtraTagTypes = { - new StyledDivTagType("error"), - new StyledDivTagType("warning"), - new StyledDivTagType("unresolved"), - new TagType("ref") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - }, - new TagType("label") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - }, - new TagType("a") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append(""); - } - }, - new TagType("style") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - }, - new TagType("class") { - @Override - public void appendOpenTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - - @Override - public void appendCloseTag(StringBuilder builder, TagData tagData) { - builder.append("
"); - } - }, - }; - private static final Map openTags = new HashMap(); - private static final Map nextTokenTags = new HashMap(); - private static final Map closedTags = new HashMap(); - private static final Map closeTags = new HashMap(); - static { - for (TagType type : knownExtraTagTypes) { - String tagName = type.tagName; - openTags.put(type, Pattern.compile("<" + tagName + "\\s*((desc)?=\\\"([^\n\"]*?)\\\")?>", Pattern.MULTILINE)); - closeTags.put(type, Pattern.compile("")); - - nextTokenTags.put(type, Pattern.compile("<" + tagName + "\\s*((desc)?=\\\"([^\n\"]*?)\\\")?:>", Pattern.MULTILINE)); - closedTags.put(type, Pattern.compile("<" + tagName + "\\s*((desc)?=\\\"([^\n\"]*?)\\\")?/>", Pattern.MULTILINE)); - } - } - - private static final Map styleMap = new HashMap(); - static { - styleMap.put(JetTokens.BLOCK_COMMENT, "jet-comment"); - styleMap.put(JetTokens.DOC_COMMENT, "jet-comment"); - styleMap.put(JetTokens.EOL_COMMENT, "jet-comment"); - styleMap.put(JetTokens.WHITE_SPACE, "whitespace"); - styleMap.put(JetTokens.INTEGER_LITERAL, "number"); - styleMap.put(JetTokens.FLOAT_LITERAL, "number"); - styleMap.put(JetTokens.OPEN_QUOTE, "string"); - styleMap.put(JetTokens.REGULAR_STRING_PART, "string"); - styleMap.put(JetTokens.ESCAPE_SEQUENCE, "escape"); - styleMap.put(JetTokens.LONG_TEMPLATE_ENTRY_START, "escape"); - styleMap.put(JetTokens.LONG_TEMPLATE_ENTRY_END, "escape"); - styleMap.put(JetTokens.SHORT_TEMPLATE_ENTRY_START, "escape"); - styleMap.put(JetTokens.ESCAPE_SEQUENCE, "escape"); - styleMap.put(JetTokens.CLOSING_QUOTE, "string"); - styleMap.put(JetTokens.CHARACTER_LITERAL, "string"); - styleMap.put(JetTokens.LABEL_IDENTIFIER, "label"); - styleMap.put(JetTokens.ATAT, "label"); - styleMap.put(JetTokens.FIELD_IDENTIFIER, "field"); - styleMap.put(JetTokens.RAW_STRING_LITERAL, "string"); - styleMap.put(TokenType.BAD_CHARACTER, "bad"); - } - - @Override - public boolean hasBody() { - return true; - } - - @Override - public RenderMode getBodyRenderMode() { - return RenderMode.allow(0); - } - - private static void escapeHTML(StringBuilder builder, CharSequence seq) { - if (seq == null) return; - for (int i = 0; i < seq.length(); i++) { - char c = seq.charAt(i); - switch (c) { - case '<': - builder.append("<"); - break; - case '>': - builder.append(">"); - break; - case '&': - builder.append("&"); - break; - case '"': - builder.append("""); - break; - default: - builder.append(c); - } - } - } - - @Override - public String execute(Map map, String code, RenderContext renderContext) throws MacroException { - try { - List tags = new ArrayList(); - - StringBuilder afterPreprocessing = preprocess(code.trim(), tags); - - VelocityContext context = new VelocityContext(MacroUtils.defaultVelocityContext()); - String renderedTemplate = VelocityUtils.getRenderedTemplate("template.velocity", context); - - StringBuilder result = new StringBuilder(renderedTemplate); - result.append( - "
" + - "
" + - "
" - ); - - _JetLexer jetLexer = new _JetLexer(DUMMY_READER); - jetLexer.reset(afterPreprocessing, 0, afterPreprocessing.length(), _JetLexer.YYINITIAL); - - Iterator iterator = tags.iterator(); - TagData tag = iterator.hasNext() ? iterator.next() : null; - while (true) { - int tokenEnd = jetLexer.getTokenEnd(); - while (tag != null && tag.end < tokenEnd) { - result.append("
Skipping a tag in the middle of a token: <").append(tag.type).append(">
"); - tag = iterator.hasNext() ? iterator.next() : null; - } - - if (tag != null) { - if (tag.start == tokenEnd) { -// result.append("
"); - tag.type.appendOpenTag(result, tag); - } - } - if (tag != null) { - if (tag.end == tokenEnd || (tag.nextToken && tag.start < tokenEnd)) { - tag.type.appendCloseTag(result, tag); - tag = iterator.hasNext() ? iterator.next() : null; - } - } - - IElementType token = jetLexer.advance(); - if (token == null) break; -// CharSequence yytext = jetLexer.yytext(); - String yytext = jetLexer.yytext().toString().replaceAll("\n", "\r\n"); - String style = null; - if (token instanceof JetKeywordToken) { - style = "keyword"; - } - else if (token == JetTokens.IDENTIFIER) { - for (IElementType softKeyword : JetTokens.SOFT_KEYWORDS.asSet()) { - if (((JetKeywordToken) softKeyword).getValue().equals(yytext.toString())) { - style = "softkeyword"; - break; - } - } - style = style == null ? "plain" : style; - } - else if (styleMap.containsKey(token)) { - style = styleMap.get(token); - } - else { - style = "plain"; - } - result.append(""); - escapeHTML(result, yytext); - result.append(""); - } - - result.append("
"); - result.append("
"); - result.append("
"); - return result.toString(); - } catch (Throwable e) { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("
Jet highlighter error [").append(e.getClass().getSimpleName()).append("]: "); - escapeHTML(stringBuilder, e.getMessage()); - stringBuilder.append("
"); - stringBuilder.append("Original text:"); - stringBuilder.append("
");
-            escapeHTML(stringBuilder, code);
-            stringBuilder.append("
"); - stringBuilder.append("
"); - return stringBuilder.toString(); - } - } - - private StringBuilder preprocess(CharSequence code, Collection tags) { - StringBuilder afterPreprocessing = new StringBuilder(); - int initialLength = afterPreprocessing.length(); - Stack tagStack = new Stack(); - charLoop: - for (int i = 0; i < code.length(); i++) { - char c = code.charAt(i); - if (c == '\r') continue; - - int position = afterPreprocessing.length() - initialLength; - - for (TagType type : knownExtraTagTypes) { - Pattern open = openTags.get(type); - Matcher openMatcher = matchFrom(code, i, open); - if (openMatcher != null) { - tagStack.push(new TagData(type, openMatcher.group(3), position, false)); - i += openMatcher.end() - 1; - continue charLoop; - } - - Pattern close = closeTags.get(type); - Matcher closeMatcher = matchFrom(code, i, close); - if (closeMatcher != null) { - if (tagStack.isEmpty()) { - throw new IllegalArgumentException("Unmatched closing tag: " + closeMatcher.group()); - } - else { - TagData tag = tagStack.pop(); - if (type != tag.type) { - throw new IllegalArgumentException("Unmatched closing tag: " + closeMatcher.group()); - } - - tag.end = position; - tags.add(tag); - i += closeMatcher.end() - 1; - continue charLoop; - } - } - - Pattern closed = closedTags.get(type); - Matcher closedMatcher = matchFrom(code, i, closed); - if (closedMatcher != null) { - TagData tag = new TagData(type, closedMatcher.group(3), position, false); - tag.end = position; - tags.add(tag); - i += closedMatcher.end() - 1; - continue charLoop; - } - - Pattern next = nextTokenTags.get(type); - Matcher nextMatcher = matchFrom(code, i, next); - if (nextMatcher != null) { - TagData tag = new TagData(type, nextMatcher.group(3), position, true); - tags.add(tag); - tag.end = code.length(); - i += nextMatcher.end() - 1; - continue charLoop; - } - - } - afterPreprocessing.append(c); - } - return afterPreprocessing; - } - - private Matcher matchFrom(CharSequence code, int start, Pattern pattern) { - CharSequence remainingInput = code.subSequence(start, code.length()); - Matcher matcher = pattern.matcher(remainingInput); - if (matcher.find() && matcher.start() == 0) { - return matcher; - } - return null; - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetToken.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetToken.java deleted file mode 100644 index 2942f6c0d64..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetToken.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * @author max - */ -package org.jetbrains.jet.lexer; - - -import com.intellij.psi.tree.IElementType; - -public class JetToken extends IElementType { - public JetToken(String debugName) { - } -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java b/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java deleted file mode 100644 index 437213997ca..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/JetTokens.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * @author max - */ -package org.jetbrains.jet.lexer; - -import com.intellij.psi.TokenType; -import com.intellij.psi.tree.IElementType; -import com.intellij.psi.tree.TokenSet; - -public interface JetTokens { - JetToken EOF = new JetToken("EOF"); - - JetToken BLOCK_COMMENT = new JetToken("BLOCK_COMMENT"); - JetToken DOC_COMMENT = new JetToken("DOC_COMMENT"); - JetToken EOL_COMMENT = new JetToken("EOL_COMMENT"); - - IElementType WHITE_SPACE = TokenType.WHITE_SPACE; - - JetToken INTEGER_LITERAL = new JetToken("INTEGER_LITERAL"); - JetToken FLOAT_LITERAL = new JetToken("FLOAT_CONSTANT"); - JetToken CHARACTER_LITERAL = new JetToken("CHARACTER_LITERAL"); - - JetToken CLOSING_QUOTE = new JetToken("CLOSING_QUOTE"); - JetToken OPEN_QUOTE = new JetToken("OPEN_QUOTE"); - JetToken REGULAR_STRING_PART = new JetToken("REGULAR_STRING_PART"); - JetToken ESCAPE_SEQUENCE = new JetToken("ESCAPE_SEQUENCE"); - JetToken SHORT_TEMPLATE_ENTRY_START = new JetToken("SHORT_TEMPLATE_ENTRY_START"); - JetToken LONG_TEMPLATE_ENTRY_START = new JetToken("LONG_TEMPLATE_ENTRY_START"); - JetToken LONG_TEMPLATE_ENTRY_END = new JetToken("LONG_TEMPLATE_ENTRY_END"); - JetToken DANGLING_NEWLINE = new JetToken("DANGLING_NEWLINE"); - - JetToken RAW_STRING_LITERAL = new JetToken("RAW_STRING_LITERAL"); - - JetKeywordToken NAMESPACE_KEYWORD = JetKeywordToken.keyword("namespace"); - JetKeywordToken AS_KEYWORD = JetKeywordToken.keyword("as"); - JetKeywordToken TYPE_KEYWORD = JetKeywordToken.keyword("type"); - JetKeywordToken CLASS_KEYWORD = JetKeywordToken.keyword("class"); - JetKeywordToken THIS_KEYWORD = JetKeywordToken.keyword("this"); - JetKeywordToken SUPER_KEYWORD = JetKeywordToken.keyword("super"); - JetKeywordToken VAL_KEYWORD = JetKeywordToken.keyword("val"); - JetKeywordToken VAR_KEYWORD = JetKeywordToken.keyword("var"); - JetKeywordToken FUN_KEYWORD = JetKeywordToken.keyword("fun"); - JetKeywordToken FOR_KEYWORD = JetKeywordToken.keyword("for"); - JetKeywordToken NULL_KEYWORD = JetKeywordToken.keyword("null"); - JetKeywordToken TRUE_KEYWORD = JetKeywordToken.keyword("true"); - JetKeywordToken FALSE_KEYWORD = JetKeywordToken.keyword("false"); - JetKeywordToken IS_KEYWORD = JetKeywordToken.keyword("is"); - JetKeywordToken IN_KEYWORD = JetKeywordToken.keyword("in"); - JetKeywordToken THROW_KEYWORD = JetKeywordToken.keyword("throw"); - JetKeywordToken RETURN_KEYWORD = JetKeywordToken.keyword("return"); - JetKeywordToken BREAK_KEYWORD = JetKeywordToken.keyword("break"); - JetKeywordToken CONTINUE_KEYWORD = JetKeywordToken.keyword("continue"); - JetKeywordToken OBJECT_KEYWORD = JetKeywordToken.keyword("object"); - JetKeywordToken IF_KEYWORD = JetKeywordToken.keyword("if"); - JetKeywordToken TRY_KEYWORD = JetKeywordToken.keyword("try"); - JetKeywordToken ELSE_KEYWORD = JetKeywordToken.keyword("else"); - JetKeywordToken WHILE_KEYWORD = JetKeywordToken.keyword("while"); - JetKeywordToken DO_KEYWORD = JetKeywordToken.keyword("do"); - JetKeywordToken WHEN_KEYWORD = JetKeywordToken.keyword("when"); - JetKeywordToken TRAIT_KEYWORD = JetKeywordToken.keyword("trait"); - // TODO: Discuss "This" keyword - JetKeywordToken CAPITALIZED_THIS_KEYWORD = JetKeywordToken.keyword("This"); - - - JetToken AS_SAFE = JetKeywordToken.keyword("AS_SAFE");//new JetToken("as?"); - - JetToken IDENTIFIER = new JetToken("IDENTIFIER"); - JetToken LABEL_IDENTIFIER = new JetToken("LABEL_IDENTIFIER"); - - JetToken FIELD_IDENTIFIER = new JetToken("FIELD_IDENTIFIER"); - JetToken LBRACKET = new JetToken("LBRACKET"); - JetToken RBRACKET = new JetToken("RBRACKET"); - JetToken LBRACE = new JetToken("LBRACE"); - JetToken RBRACE = new JetToken("RBRACE"); - JetToken LPAR = new JetToken("LPAR"); - JetToken RPAR = new JetToken("RPAR"); - JetToken DOT = new JetToken("DOT"); - JetToken PLUSPLUS = new JetToken("PLUSPLUS"); - JetToken MINUSMINUS = new JetToken("MINUSMINUS"); - JetToken MUL = new JetToken("MUL"); - JetToken PLUS = new JetToken("PLUS"); - JetToken MINUS = new JetToken("MINUS"); - JetToken EXCL = new JetToken("EXCL"); - JetToken DIV = new JetToken("DIV"); - JetToken PERC = new JetToken("PERC"); - JetToken LT = new JetToken("LT"); - JetToken GT = new JetToken("GT"); - JetToken LTEQ = new JetToken("LTEQ"); - JetToken GTEQ = new JetToken("GTEQ"); - JetToken EQEQEQ = new JetToken("EQEQEQ"); - JetToken ARROW = new JetToken("ARROW"); - JetToken DOUBLE_ARROW = new JetToken("DOUBLE_ARROW"); - JetToken EXCLEQEQEQ = new JetToken("EXCLEQEQEQ"); - JetToken EQEQ = new JetToken("EQEQ"); - JetToken EXCLEQ = new JetToken("EXCLEQ"); - JetToken ANDAND = new JetToken("ANDAND"); - JetToken OROR = new JetToken("OROR"); - JetToken SAFE_ACCESS = new JetToken("SAFE_ACCESS"); - JetToken ELVIS = new JetToken("ELVIS"); - // JetToken MAP = new JetToken("MAP"); -// JetToken FILTER = new JetToken("FILTER"); - JetToken QUEST = new JetToken("QUEST"); - JetToken COLON = new JetToken("COLON"); - JetToken SEMICOLON = new JetToken("SEMICOLON"); - JetToken RANGE = new JetToken("RANGE"); - JetToken EQ = new JetToken("EQ"); - JetToken MULTEQ = new JetToken("MULTEQ"); - JetToken DIVEQ = new JetToken("DIVEQ"); - JetToken PERCEQ = new JetToken("PERCEQ"); - JetToken PLUSEQ = new JetToken("PLUSEQ"); - JetToken MINUSEQ = new JetToken("MINUSEQ"); - JetToken NOT_IN = JetKeywordToken.keyword("NOT_IN"); - JetToken NOT_IS = JetKeywordToken.keyword("NOT_IS"); - JetToken HASH = new JetToken("HASH"); - JetToken AT = new JetToken("AT"); - JetToken ATAT = new JetToken("ATAT"); - - TokenSet LABELS = TokenSet.create(AT, ATAT, LABEL_IDENTIFIER); - - JetToken COMMA = new JetToken("COMMA"); - - JetToken EOL_OR_SEMICOLON = new JetToken("EOL_OR_SEMICOLON"); - JetKeywordToken IMPORT_KEYWORD = JetKeywordToken.softKeyword("import"); - JetKeywordToken WHERE_KEYWORD = JetKeywordToken.softKeyword("where"); - JetKeywordToken BY_KEYWORD = JetKeywordToken.softKeyword("by"); - JetKeywordToken GET_KEYWORD = JetKeywordToken.softKeyword("get"); - JetKeywordToken SET_KEYWORD = JetKeywordToken.softKeyword("set"); - JetKeywordToken ABSTRACT_KEYWORD = JetKeywordToken.softKeyword("abstract"); - JetKeywordToken ENUM_KEYWORD = JetKeywordToken.softKeyword("enum"); - JetKeywordToken OPEN_KEYWORD = JetKeywordToken.softKeyword("open"); - JetKeywordToken ANNOTATION_KEYWORD = JetKeywordToken.softKeyword("annotation"); - JetKeywordToken OVERRIDE_KEYWORD = JetKeywordToken.softKeyword("override"); - JetKeywordToken PRIVATE_KEYWORD = JetKeywordToken.softKeyword("private"); - JetKeywordToken PUBLIC_KEYWORD = JetKeywordToken.softKeyword("public"); - JetKeywordToken INTERNAL_KEYWORD = JetKeywordToken.softKeyword("internal"); - JetKeywordToken PROTECTED_KEYWORD = JetKeywordToken.softKeyword("protected"); - JetKeywordToken CATCH_KEYWORD = JetKeywordToken.softKeyword("catch"); - JetKeywordToken OUT_KEYWORD = JetKeywordToken.softKeyword("out"); - JetKeywordToken VARARG_KEYWORD = JetKeywordToken.softKeyword("vararg"); - JetKeywordToken INLINE_KEYWORD = JetKeywordToken.softKeyword("inline"); - - JetKeywordToken FINALLY_KEYWORD = JetKeywordToken.softKeyword("finally"); - JetKeywordToken FINAL_KEYWORD = JetKeywordToken.softKeyword("final"); - - // TODO: support this as an annotation on arguments. Then, they it probably can not be a soft keyword - JetKeywordToken REF_KEYWORD = JetKeywordToken.softKeyword("ref"); - - TokenSet KEYWORDS = TokenSet.create(NAMESPACE_KEYWORD, AS_KEYWORD, TYPE_KEYWORD, CLASS_KEYWORD, TRAIT_KEYWORD, - THIS_KEYWORD, SUPER_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, FUN_KEYWORD, FOR_KEYWORD, - NULL_KEYWORD, - TRUE_KEYWORD, FALSE_KEYWORD, IS_KEYWORD, - IN_KEYWORD, THROW_KEYWORD, RETURN_KEYWORD, BREAK_KEYWORD, CONTINUE_KEYWORD, OBJECT_KEYWORD, IF_KEYWORD, - ELSE_KEYWORD, WHILE_KEYWORD, DO_KEYWORD, TRY_KEYWORD, WHEN_KEYWORD, - NOT_IN, NOT_IS, CAPITALIZED_THIS_KEYWORD, AS_SAFE - ); - - TokenSet SOFT_KEYWORDS = TokenSet.create(IMPORT_KEYWORD, WHERE_KEYWORD, BY_KEYWORD, GET_KEYWORD, - SET_KEYWORD, ABSTRACT_KEYWORD, ENUM_KEYWORD, OPEN_KEYWORD, ANNOTATION_KEYWORD, - OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, PROTECTED_KEYWORD, - CATCH_KEYWORD, FINALLY_KEYWORD, REF_KEYWORD, OUT_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD - ); - - TokenSet MODIFIER_KEYWORDS = TokenSet.create(ABSTRACT_KEYWORD, ENUM_KEYWORD, - OPEN_KEYWORD, ANNOTATION_KEYWORD, OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, - PROTECTED_KEYWORD, REF_KEYWORD, OUT_KEYWORD, IN_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD - ); - TokenSet WHITE_SPACE_OR_COMMENT_BIT_SET = TokenSet.create(WHITE_SPACE, BLOCK_COMMENT, EOL_COMMENT, DOC_COMMENT); - TokenSet WHITESPACES = TokenSet.create(TokenType.WHITE_SPACE); - TokenSet COMMENTS = TokenSet.create(EOL_COMMENT, BLOCK_COMMENT, DOC_COMMENT); - - TokenSet STRINGS = TokenSet.create(CHARACTER_LITERAL, REGULAR_STRING_PART, RAW_STRING_LITERAL); - TokenSet OPERATIONS = TokenSet.create(AS_KEYWORD, AS_SAFE, IS_KEYWORD, IN_KEYWORD, DOT, PLUSPLUS, MINUSMINUS, MUL, PLUS, - MINUS, EXCL, DIV, PERC, LT, GT, LTEQ, GTEQ, EQEQEQ, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR, - SAFE_ACCESS, ELVIS, -// MAP, FILTER, - QUEST, COLON, - RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ, - NOT_IN, NOT_IS, -// HASH, - IDENTIFIER, LABEL_IDENTIFIER, ATAT, AT); - - TokenSet AUGMENTED_ASSIGNMENTS = TokenSet.create(PLUSEQ, MINUSEQ, MULTEQ, PERCEQ, DIVEQ); -} diff --git a/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java b/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java deleted file mode 100644 index b6660dde6f0..00000000000 --- a/confluence/src/main/java/org/jetbrains/jet/lexer/_JetLexer.java +++ /dev/null @@ -1,1265 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* The following code was generated by JFlex 1.4.3 on 1/10/12 4:31 PM */ - -package org.jetbrains.jet.lexer; - -import java.util.*; -import com.intellij.lexer.*; -import com.intellij.psi.*; -import com.intellij.psi.tree.IElementType; - -import org.jetbrains.jet.lexer.JetTokens; - - -/** - * This class is a scanner generated by - * JFlex 1.4.3 - * on 1/10/12 4:31 PM from the specification file - * /Users/abreslav/work/jet/confluence/../compiler/frontend/src/org/jetbrains/jet/lexer/Jet.flex - */ -class _JetLexer implements FlexLexer { - /** initial size of the lookahead buffer */ - private static final int ZZ_BUFFERSIZE = 16384; - - /** lexical states */ - public static final int STRING = 2; - public static final int YYINITIAL = 0; - public static final int LONG_TEMPLATE_ENTRY = 6; - public static final int SHORT_TEMPLATE_ENTRY = 4; - - /** - * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l - * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l - * at the beginning of a line - * l is of the form l = 2*k, k a non negative integer - */ - private static final int ZZ_LEXSTATE[] = { - 0, 0, 1, 1, 2, 2, 3, 3 - }; - - /** - * Translates characters to character classes - */ - private static final String ZZ_CMAP_PACKED = - "\11\0\1\3\1\7\1\0\1\3\23\0\1\3\1\57\1\25\1\77"+ - "\1\10\1\67\1\65\1\23\1\72\1\73\1\13\1\62\1\76\1\21"+ - "\1\17\1\12\1\14\11\1\1\74\1\75\1\63\1\60\1\64\1\61"+ - "\1\11\1\2\1\16\2\2\1\20\1\2\11\4\1\22\3\4\1\54"+ - "\3\4\1\15\2\4\1\70\1\24\1\71\1\0\1\4\1\6\1\42"+ - "\1\46\1\35\1\56\1\40\1\52\1\44\1\32\1\33\1\47\1\43"+ - "\1\51\1\4\1\37\1\36\1\41\1\4\1\45\1\34\1\31\1\26"+ - "\1\55\1\50\1\15\1\53\1\4\1\27\1\66\1\30\54\0\1\4"+ - "\12\0\1\4\4\0\1\4\5\0\27\4\1\0\37\4\1\0\u013f\4"+ - "\31\0\162\4\4\0\14\4\16\0\5\4\11\0\1\4\213\0\1\4"+ - "\13\0\1\4\1\0\3\4\1\0\1\4\1\0\24\4\1\0\54\4"+ - "\1\0\46\4\1\0\5\4\4\0\202\4\10\0\105\4\1\0\46\4"+ - "\2\0\2\4\6\0\20\4\41\0\46\4\2\0\1\4\7\0\47\4"+ - "\110\0\33\4\5\0\3\4\56\0\32\4\5\0\13\4\25\0\12\5"+ - "\4\0\2\4\1\0\143\4\1\0\1\4\17\0\2\4\7\0\2\4"+ - "\12\5\3\4\2\0\1\4\20\0\1\4\1\0\36\4\35\0\3\4"+ - "\60\0\46\4\13\0\1\4\u0152\0\66\4\3\0\1\4\22\0\1\4"+ - "\7\0\12\4\4\0\12\5\25\0\10\4\2\0\2\4\2\0\26\4"+ - "\1\0\7\4\1\0\1\4\3\0\4\4\3\0\1\4\36\0\2\4"+ - "\1\0\3\4\4\0\12\5\2\4\23\0\6\4\4\0\2\4\2\0"+ - "\26\4\1\0\7\4\1\0\2\4\1\0\2\4\1\0\2\4\37\0"+ - "\4\4\1\0\1\4\7\0\12\5\2\0\3\4\20\0\11\4\1\0"+ - "\3\4\1\0\26\4\1\0\7\4\1\0\2\4\1\0\5\4\3\0"+ - "\1\4\22\0\1\4\17\0\2\4\4\0\12\5\25\0\10\4\2\0"+ - "\2\4\2\0\26\4\1\0\7\4\1\0\2\4\1\0\5\4\3\0"+ - "\1\4\36\0\2\4\1\0\3\4\4\0\12\5\1\0\1\4\21\0"+ - "\1\4\1\0\6\4\3\0\3\4\1\0\4\4\3\0\2\4\1\0"+ - "\1\4\1\0\2\4\3\0\2\4\3\0\3\4\3\0\10\4\1\0"+ - "\3\4\55\0\11\5\25\0\10\4\1\0\3\4\1\0\27\4\1\0"+ - "\12\4\1\0\5\4\46\0\2\4\4\0\12\5\25\0\10\4\1\0"+ - "\3\4\1\0\27\4\1\0\12\4\1\0\5\4\3\0\1\4\40\0"+ - "\1\4\1\0\2\4\4\0\12\5\25\0\10\4\1\0\3\4\1\0"+ - "\27\4\1\0\20\4\46\0\2\4\4\0\12\5\25\0\22\4\3\0"+ - "\30\4\1\0\11\4\1\0\1\4\2\0\7\4\72\0\60\4\1\0"+ - "\2\4\14\0\7\4\11\0\12\5\47\0\2\4\1\0\1\4\2\0"+ - "\2\4\1\0\1\4\2\0\1\4\6\0\4\4\1\0\7\4\1\0"+ - "\3\4\1\0\1\4\1\0\1\4\2\0\2\4\1\0\4\4\1\0"+ - "\2\4\11\0\1\4\2\0\5\4\1\0\1\4\11\0\12\5\2\0"+ - "\2\4\42\0\1\4\37\0\12\5\26\0\10\4\1\0\42\4\35\0"+ - "\4\4\164\0\42\4\1\0\5\4\1\0\2\4\25\0\12\5\6\0"+ - "\6\4\112\0\46\4\12\0\51\4\7\0\132\4\5\0\104\4\5\0"+ - "\122\4\6\0\7\4\1\0\77\4\1\0\1\4\1\0\4\4\2\0"+ - "\7\4\1\0\1\4\1\0\4\4\2\0\47\4\1\0\1\4\1\0"+ - "\4\4\2\0\37\4\1\0\1\4\1\0\4\4\2\0\7\4\1\0"+ - "\1\4\1\0\4\4\2\0\7\4\1\0\7\4\1\0\27\4\1\0"+ - "\37\4\1\0\1\4\1\0\4\4\2\0\7\4\1\0\47\4\1\0"+ - "\23\4\16\0\11\5\56\0\125\4\14\0\u026c\4\2\0\10\4\12\0"+ - "\32\4\5\0\113\4\25\0\15\4\1\0\4\4\16\0\22\4\16\0"+ - "\22\4\16\0\15\4\1\0\3\4\17\0\64\4\43\0\1\4\4\0"+ - "\1\4\3\0\12\5\46\0\12\5\6\0\130\4\10\0\51\4\127\0"+ - "\35\4\51\0\12\5\36\4\2\0\5\4\u038b\0\154\4\224\0\234\4"+ - "\4\0\132\4\6\0\26\4\2\0\6\4\2\0\46\4\2\0\6\4"+ - "\2\0\10\4\1\0\1\4\1\0\1\4\1\0\1\4\1\0\37\4"+ - "\2\0\65\4\1\0\7\4\1\0\1\4\3\0\3\4\1\0\7\4"+ - "\3\0\4\4\2\0\6\4\4\0\15\4\5\0\3\4\1\0\7\4"+ - "\164\0\1\4\15\0\1\4\202\0\1\4\4\0\1\4\2\0\12\4"+ - "\1\0\1\4\3\0\5\4\6\0\1\4\1\0\1\4\1\0\1\4"+ - "\1\0\4\4\1\0\3\4\1\0\7\4\3\0\3\4\5\0\5\4"+ - "\u0ebb\0\2\4\52\0\5\4\5\0\2\4\4\0\126\4\6\0\3\4"+ - "\1\0\132\4\1\0\4\4\5\0\50\4\4\0\136\4\21\0\30\4"+ - "\70\0\20\4\u0200\0\u19b6\4\112\0\u51a6\4\132\0\u048d\4\u0773\0\u2ba4\4"+ - "\u215c\0\u012e\4\2\0\73\4\225\0\7\4\14\0\5\4\5\0\1\4"+ - "\1\0\12\4\1\0\15\4\1\0\5\4\1\0\1\4\1\0\2\4"+ - "\1\0\2\4\1\0\154\4\41\0\u016b\4\22\0\100\4\2\0\66\4"+ - "\50\0\14\4\164\0\5\4\1\0\207\4\23\0\12\5\7\0\32\4"+ - "\6\0\32\4\13\0\131\4\3\0\6\4\2\0\6\4\2\0\6\4"+ - "\2\0\3\4\43\0"; - - /** - * Translates characters to character classes - */ - private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); - - /** - * Translates DFA states to action switch labels. - */ - private static final int [] ZZ_ACTION = zzUnpackAction(); - - private static final String ZZ_ACTION_PACKED_0 = - "\4\0\1\1\1\2\1\3\1\4\2\1\1\5\1\6"+ - "\1\7\1\2\1\10\1\11\1\12\1\13\1\14\1\15"+ - "\20\3\1\16\1\17\1\20\1\21\1\22\1\23\2\1"+ - "\1\24\1\25\1\26\1\27\1\30\1\31\1\32\1\33"+ - "\1\34\1\35\1\36\1\35\1\0\1\37\1\40\1\0"+ - "\1\40\1\41\1\42\1\0\1\43\1\0\1\44\1\0"+ - "\1\45\1\0\1\46\1\47\1\50\1\51\1\52\1\43"+ - "\2\2\1\43\1\53\1\54\1\55\1\56\2\12\1\0"+ - "\3\3\1\57\1\60\1\61\7\3\1\62\10\3\1\63"+ - "\1\0\1\64\1\65\1\66\1\67\1\70\1\71\1\72"+ - "\1\73\1\74\1\75\1\76\1\0\1\77\2\100\1\0"+ - "\1\40\1\101\1\43\1\3\2\0\1\50\1\102\4\0"+ - "\1\103\4\3\1\104\10\3\1\105\4\3\1\106\1\107"+ - "\2\3\1\110\1\111\1\112\1\113\1\114\1\115\2\0"+ - "\2\40\1\44\1\45\1\0\2\102\1\43\2\0\1\116"+ - "\1\3\1\117\1\3\1\120\4\3\1\121\1\122\4\3"+ - "\1\123\1\3\1\124\1\125\1\76\1\0\1\126\1\50"+ - "\2\0\1\127\1\130\1\131\1\3\1\132\3\3\1\133"+ - "\1\134\1\135\1\0\1\103\1\3\1\136\1\3\1\137"+ - "\1\3\1\140\1\141"; - - private static int [] zzUnpackAction() { - int [] result = new int[224]; - int offset = 0; - offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAction(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /** - * Translates a state to a row index in the transition table - */ - private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); - - private static final String ZZ_ROWMAP_PACKED_0 = - "\0\0\0\100\0\200\0\300\0\u0100\0\u0140\0\u0180\0\u01c0"+ - "\0\u0200\0\u0240\0\u0280\0\u02c0\0\u0300\0\u0340\0\u0380\0\u03c0"+ - "\0\u0400\0\u0440\0\u0100\0\u0100\0\u0480\0\u04c0\0\u0500\0\u0540"+ - "\0\u0580\0\u05c0\0\u0600\0\u0640\0\u0680\0\u06c0\0\u0700\0\u0740"+ - "\0\u0780\0\u07c0\0\u0800\0\u0840\0\u0880\0\u08c0\0\u0100\0\u0900"+ - "\0\u0940\0\u0980\0\u09c0\0\u0a00\0\u0a40\0\u0100\0\u0100\0\u0100"+ - "\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100\0\u0a80\0\u0100\0\u0ac0"+ - "\0\u0b00\0\u0100\0\u0b40\0\u0b80\0\u0bc0\0\u0100\0\u0100\0\u0c00"+ - "\0\u0c40\0\u0c80\0\u0cc0\0\u0d00\0\u0d40\0\u0d80\0\u0100\0\u0dc0"+ - "\0\u0e00\0\u0100\0\u0100\0\u0e40\0\u0e80\0\u0ec0\0\u0f00\0\u0100"+ - "\0\u0100\0\u0100\0\u0100\0\u0100\0\u0f40\0\u0f80\0\u0fc0\0\u1000"+ - "\0\u1040\0\u0180\0\u0180\0\u0180\0\u1080\0\u10c0\0\u1100\0\u1140"+ - "\0\u1180\0\u11c0\0\u1200\0\u1240\0\u1280\0\u12c0\0\u1300\0\u1340"+ - "\0\u1380\0\u13c0\0\u1400\0\u1440\0\u0180\0\u1480\0\u14c0\0\u1500"+ - "\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100\0\u0100"+ - "\0\u1540\0\u1580\0\u0100\0\u0100\0\u15c0\0\u1600\0\u1640\0\u0100"+ - "\0\u1680\0\u0100\0\u16c0\0\u1700\0\u1740\0\u1780\0\u17c0\0\u1800"+ - "\0\u1840\0\u1880\0\u18c0\0\u1900\0\u1940\0\u1980\0\u19c0\0\u0180"+ - "\0\u1a00\0\u1a40\0\u1a80\0\u1ac0\0\u1b00\0\u1b40\0\u1b80\0\u1bc0"+ - "\0\u0100\0\u1c00\0\u1c40\0\u1c80\0\u1cc0\0\u0180\0\u0180\0\u1d00"+ - "\0\u1d40\0\u0180\0\u0180\0\u1d80\0\u1d80\0\u0100\0\u0100\0\u1dc0"+ - "\0\u1e00\0\u0100\0\u1e40\0\u0100\0\u0100\0\u1e80\0\u1ec0\0\u0100"+ - "\0\u1f00\0\u1680\0\u1f40\0\u0180\0\u1f80\0\u0180\0\u1fc0\0\u0180"+ - "\0\u2000\0\u2040\0\u2080\0\u20c0\0\u0180\0\u0180\0\u2100\0\u2140"+ - "\0\u2180\0\u21c0\0\u0180\0\u2200\0\u0180\0\u0100\0\u0100\0\u2240"+ - "\0\u0b40\0\u0100\0\u2280\0\u22c0\0\u0180\0\u0180\0\u0180\0\u2300"+ - "\0\u0180\0\u2340\0\u2380\0\u23c0\0\u0180\0\u0180\0\u0180\0\u2400"+ - "\0\u0100\0\u2440\0\u0180\0\u2480\0\u0180\0\u24c0\0\u0180\0\u0180"; - - private static int [] zzUnpackRowMap() { - int [] result = new int[224]; - int offset = 0; - offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackRowMap(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int high = packed.charAt(i++) << 16; - result[j++] = high | packed.charAt(i++); - } - return j; - } - - /** - * The transition table of the DFA - */ - private static final int [] ZZ_TRANS = zzUnpackTrans(); - - private static final String ZZ_TRANS_PACKED_0 = - "\1\5\1\6\1\7\1\10\1\7\1\5\1\11\1\10"+ - "\1\12\1\13\1\14\1\15\1\16\2\7\1\17\1\7"+ - "\1\20\1\7\1\21\1\5\1\22\1\7\1\23\1\24"+ - "\1\25\1\7\1\26\1\27\1\30\1\31\1\32\1\33"+ - "\1\34\1\35\2\7\1\36\1\37\1\7\1\40\1\7"+ - "\1\41\1\7\1\42\1\43\1\44\1\45\1\46\1\47"+ - "\1\50\1\51\1\52\1\53\1\54\1\55\1\56\1\57"+ - "\1\60\1\61\1\62\1\63\1\64\1\65\7\66\1\67"+ - "\1\70\13\66\1\71\1\72\52\66\2\0\1\73\1\0"+ - "\1\73\1\0\1\74\6\0\2\73\1\0\1\73\1\0"+ - "\1\73\3\0\1\73\2\0\1\75\25\73\21\0\1\5"+ - "\1\6\1\7\1\10\1\7\1\5\1\11\1\10\1\12"+ - "\1\13\1\14\1\15\1\16\2\7\1\17\1\7\1\20"+ - "\1\7\1\21\1\5\1\22\1\7\1\76\1\77\1\25"+ - "\1\7\1\26\1\27\1\30\1\31\1\32\1\33\1\34"+ - "\1\35\2\7\1\36\1\37\1\7\1\40\1\7\1\41"+ - "\1\7\1\42\1\43\1\44\1\45\1\46\1\47\1\50"+ - "\1\51\1\52\1\53\1\54\1\55\1\56\1\57\1\60"+ - "\1\61\1\62\1\63\1\64\1\65\101\0\1\6\12\0"+ - "\1\6\2\0\1\100\1\101\17\0\1\101\40\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\26\7\24\0\1\10\3\0\1\10"+ - "\70\0\6\102\2\0\70\102\2\0\1\103\1\0\1\103"+ - "\1\0\1\104\6\0\2\103\1\0\1\103\1\0\1\103"+ - "\3\0\1\103\2\0\26\103\23\0\1\105\1\0\1\105"+ - "\1\0\1\106\2\0\1\107\3\0\2\105\1\0\1\105"+ - "\1\0\1\105\3\0\1\105\2\0\26\105\33\0\1\110"+ - "\1\111\44\0\1\112\77\0\1\113\20\0\1\114\12\0"+ - "\1\114\1\115\1\116\1\100\1\101\17\0\1\101\5\0"+ - "\1\116\32\0\1\117\12\0\1\117\2\0\1\120\101\0"+ - "\1\121\36\0\1\122\3\0\1\123\13\0\7\21\1\0"+ - "\13\21\1\124\1\125\53\21\25\0\1\126\53\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\1\7\1\127\12\7\1\130\5\7"+ - "\1\131\3\7\22\0\2\7\1\0\2\7\6\0\3\7"+ - "\1\0\1\7\1\0\1\7\3\0\1\7\2\0\3\7"+ - "\1\132\2\7\1\133\12\7\1\134\4\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\135\2\0\26\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\5\7\1\136\12\7\1\137\5\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\15\7\1\140\10\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\141\2\0\26\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\20\7\1\142\5\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\11\7\1\143\14\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\3\7\1\144\22\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\7\7\1\145\16\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\14\7\1\146\11\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\1\7\1\147\24\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\150"+ - "\2\0\5\7\1\151\3\7\1\152\14\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\1\7\1\153\24\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\11\7\1\154\14\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\5\7\1\155\20\7\54\0\1\156"+ - "\24\0\1\157\77\0\1\160\3\0\1\161\73\0\1\162"+ - "\1\0\1\163\75\0\1\164\77\0\1\165\104\0\1\166"+ - "\100\0\1\167\71\0\1\170\17\0\7\66\2\0\13\66"+ - "\2\0\52\66\2\0\1\171\1\0\1\171\1\0\1\172"+ - "\6\0\2\171\1\0\1\171\1\0\1\171\3\0\1\171"+ - "\1\173\1\0\26\171\21\0\7\174\1\0\16\174\1\175"+ - "\51\174\1\0\2\73\1\0\2\73\6\0\3\73\1\0"+ - "\1\73\1\0\1\73\3\0\1\73\2\0\26\73\21\0"+ - "\6\176\2\0\70\176\1\0\2\73\1\0\2\73\6\0"+ - "\3\73\1\0\1\73\1\0\1\73\3\0\1\73\2\0"+ - "\1\73\1\177\24\73\22\0\1\117\12\0\1\117\2\0"+ - "\1\200\61\0\1\201\12\0\1\201\4\0\1\201\40\0"+ - "\1\201\15\0\6\102\1\202\1\0\70\102\1\0\2\103"+ - "\1\0\2\103\6\0\3\103\1\0\1\103\1\0\1\103"+ - "\3\0\1\103\2\0\26\103\21\0\6\203\2\0\70\203"+ - "\1\0\2\105\1\0\2\105\6\0\3\105\1\0\1\105"+ - "\1\0\1\105\3\0\1\105\2\0\26\105\21\0\6\204"+ - "\2\0\70\204\7\110\1\0\70\110\13\205\1\206\64\205"+ - "\1\0\1\114\12\0\1\114\2\0\1\207\1\101\17\0"+ - "\1\101\40\0\2\115\11\0\1\115\1\0\1\115\1\210"+ - "\1\115\1\0\1\211\12\0\1\115\2\0\1\115\1\211"+ - "\1\115\3\0\1\115\3\0\1\115\3\0\1\115\22\0"+ - "\1\116\12\0\1\116\2\0\1\212\61\0\1\117\12\0"+ - "\1\117\3\0\1\101\17\0\1\101\37\0\7\21\1\0"+ - "\70\21\25\0\1\213\53\0\2\7\1\0\2\7\6\0"+ - "\3\7\1\0\1\7\1\0\1\7\3\0\1\7\2\0"+ - "\2\7\1\214\11\7\1\215\11\7\22\0\2\7\1\0"+ - "\2\7\6\0\3\7\1\0\1\7\1\0\1\7\3\0"+ - "\1\216\2\0\11\7\1\217\10\7\1\220\3\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\10\7\1\221\15\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\10\7\1\222\15\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\6\7\1\223\17\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\11\7\1\224\14\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\16\7\1\225\7\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\20\7\1\226\5\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\3\7\1\227\22\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\4\7\1\230\21\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\26\7\2\0\1\231\17\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\1\232\25\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\7\7\1\233\16\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\2\7\1\234\4\7\1\235\16\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\6\7\1\236\17\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\14\7\1\237\11\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\20\7\1\240\5\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\2\7\1\241\23\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\14\7\1\242\3\7"+ - "\1\243\5\7\55\0\1\244\2\0\1\245\120\0\1\246"+ - "\77\0\1\247\20\0\2\171\1\0\2\171\6\0\3\171"+ - "\1\0\1\171\1\0\1\171\3\0\1\171\2\0\26\171"+ - "\21\0\6\250\2\0\70\250\1\0\2\251\11\0\1\251"+ - "\1\0\1\251\1\0\1\251\14\0\1\251\2\0\1\251"+ - "\1\0\1\251\3\0\1\251\3\0\1\251\3\0\1\251"+ - "\21\0\6\176\1\252\1\0\70\176\1\0\2\73\1\0"+ - "\2\73\6\0\3\73\1\0\1\73\1\0\1\73\3\0"+ - "\1\73\2\0\2\73\1\253\23\73\22\0\1\201\12\0"+ - "\1\201\63\0\6\203\1\254\1\0\70\203\6\204\1\255"+ - "\1\0\70\204\13\205\1\256\64\205\12\257\1\260\1\206"+ - "\64\257\1\0\1\117\12\0\1\117\64\0\2\261\11\0"+ - "\1\261\1\0\1\261\1\200\1\261\14\0\1\261\2\0"+ - "\1\261\1\0\1\261\3\0\1\261\3\0\1\261\3\0"+ - "\1\261\22\0\1\201\12\0\1\201\4\0\1\262\40\0"+ - "\1\262\34\0\1\200\60\0\25\213\1\263\52\213\1\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\3\7\1\264\22\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\5\7\1\265\20\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\7\7\1\266\16\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\2\7\1\267\23\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\7\7\1\270\16\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\7\7\1\271\16\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\1\272\25\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\3\7\1\273\22\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\7\7\1\274\16\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\20\7\1\275\5\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\7\7\1\276\16\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\7\2\0\12\7\1\277\13\7\22\0\2\7"+ - "\1\0\2\7\6\0\3\7\1\0\1\7\1\0\1\7"+ - "\3\0\1\300\2\0\26\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\11\7\1\301\14\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\20\7\1\302\5\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\6\7\1\303\17\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\3\7\1\304\22\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\3\7\1\305\22\7\22\0\2\306\1\0\2\306"+ - "\6\0\3\306\1\0\1\306\1\0\1\306\3\0\1\306"+ - "\2\0\26\306\21\0\6\250\1\307\1\0\70\250\1\0"+ - "\2\310\11\0\1\310\1\0\1\310\1\0\1\310\14\0"+ - "\1\310\2\0\1\310\1\0\1\310\3\0\1\310\3\0"+ - "\1\310\3\0\1\310\22\0\2\73\1\0\2\73\6\0"+ - "\3\73\1\0\1\73\1\0\1\73\3\0\1\73\2\0"+ - "\3\73\1\311\22\73\21\0\12\205\1\312\1\256\64\205"+ - "\13\257\1\313\64\257\1\0\2\261\11\0\1\261\1\0"+ - "\1\261\1\0\1\261\1\0\1\211\12\0\1\261\2\0"+ - "\1\261\1\211\1\261\3\0\1\261\3\0\1\261\3\0"+ - "\1\261\21\0\25\213\1\314\52\213\1\0\2\7\1\0"+ - "\2\7\6\0\3\7\1\0\1\7\1\0\1\7\3\0"+ - "\1\7\2\0\17\7\1\315\6\7\22\0\2\7\1\0"+ - "\2\7\6\0\3\7\1\0\1\7\1\0\1\7\3\0"+ - "\1\7\2\0\1\316\25\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\14\7\1\317\11\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\2\7\1\320\23\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\3\7\1\321\22\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\4\7\1\322\21\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\11\7\1\323\14\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\14\7\1\324\11\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\12\7\1\325\13\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\7\7\1\326\16\7\22\0\2\7\1\0\2\7"+ - "\6\0\3\7\1\0\1\7\1\0\1\7\3\0\1\7"+ - "\2\0\7\7\1\327\16\7\22\0\2\330\11\0\1\330"+ - "\1\0\1\330\1\0\1\330\14\0\1\330\2\0\1\330"+ - "\1\0\1\330\3\0\1\330\3\0\1\330\3\0\1\330"+ - "\21\0\12\257\1\260\1\313\64\257\25\213\1\331\52\213"+ - "\1\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\6\7\1\332\17\7"+ - "\22\0\2\7\1\0\2\7\6\0\3\7\1\0\1\7"+ - "\1\0\1\7\3\0\1\7\2\0\1\333\25\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\13\7\1\334\12\7\22\0"+ - "\2\7\1\0\2\7\6\0\3\7\1\0\1\7\1\0"+ - "\1\7\3\0\1\7\2\0\6\7\1\335\17\7\22\0"+ - "\2\174\11\0\1\174\1\0\1\174\1\0\1\174\14\0"+ - "\1\174\2\0\1\174\1\0\1\174\3\0\1\174\3\0"+ - "\1\174\3\0\1\174\22\0\2\7\1\0\2\7\6\0"+ - "\3\7\1\0\1\7\1\0\1\7\3\0\1\336\2\0"+ - "\26\7\22\0\2\7\1\0\2\7\6\0\3\7\1\0"+ - "\1\7\1\0\1\7\3\0\1\7\2\0\7\7\1\337"+ - "\16\7\22\0\2\7\1\0\2\7\6\0\3\7\1\0"+ - "\1\7\1\0\1\7\3\0\1\7\2\0\7\7\1\340"+ - "\16\7\21\0"; - - private static int [] zzUnpackTrans() { - int [] result = new int[9472]; - int offset = 0; - offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackTrans(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - value--; - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /* error codes */ - private static final int ZZ_UNKNOWN_ERROR = 0; - private static final int ZZ_NO_MATCH = 1; - private static final int ZZ_PUSHBACK_2BIG = 2; - private static final char[] EMPTY_BUFFER = new char[0]; - private static final int YYEOF = -1; - private static java.io.Reader zzReader = null; // Fake - - /* error messages for the codes above */ - private static final String ZZ_ERROR_MSG[] = { - "Unkown internal scanner error", - "Error: could not match input", - "Error: pushback value was too large" - }; - - /** - * ZZ_ATTRIBUTE[aState] contains the attributes of state aState - */ - private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); - - private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\4\0\1\11\15\1\2\11\22\1\1\11\6\1\10\11"+ - "\1\1\1\11\1\1\1\0\1\11\1\1\1\0\1\1"+ - "\2\11\1\0\1\1\1\0\1\1\1\0\1\1\1\0"+ - "\1\11\2\1\2\11\4\1\5\11\1\1\1\0\27\1"+ - "\1\0\2\1\10\11\1\1\1\0\2\11\1\1\1\0"+ - "\1\1\1\11\1\1\1\11\2\0\2\1\4\0\16\1"+ - "\1\11\14\1\2\11\2\0\1\11\1\1\2\11\1\0"+ - "\1\1\1\11\1\1\2\0\22\1\2\11\1\0\1\1"+ - "\1\11\2\0\13\1\1\0\1\11\7\1"; - - private static int [] zzUnpackAttribute() { - int [] result = new int[224]; - int offset = 0; - offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAttribute(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - /** the current state of the DFA */ - private int zzState; - - /** the current lexical state */ - private int zzLexicalState = YYINITIAL; - - /** this buffer contains the current text to be matched and is - the source of the yytext() string */ - private CharSequence zzBuffer = ""; - - /** this buffer may contains the current text array to be matched when it is cheap to acquire it */ - private char[] zzBufferArray; - - /** the textposition at the last accepting state */ - private int zzMarkedPos; - - /** the textposition at the last state to be included in yytext */ - private int zzPushbackPos; - - /** the current text position in the buffer */ - private int zzCurrentPos; - - /** startRead marks the beginning of the yytext() string in the buffer */ - private int zzStartRead; - - /** endRead marks the last character in the buffer, that has been read - from input */ - private int zzEndRead; - - /** - * zzAtBOL == true <=> the scanner is currently at the beginning of a line - */ - private boolean zzAtBOL = true; - - /** zzAtEOF == true <=> the scanner is at the EOF */ - private boolean zzAtEOF; - - /** denotes if the user-EOF-code has already been executed */ - private boolean zzEOFDone; - - /* user code: */ - private static final class State { - final int lBraceCount; - final int state; - - public State(int state, int lBraceCount) { - this.state = state; - this.lBraceCount = lBraceCount; - } - } - - private final Stack states = new Stack(); - private int lBraceCount; - - private void pushState(int state) { - states.push(new State(yystate(), lBraceCount)); - lBraceCount = 0; - yybegin(state); - } - - private void popState() { - State state = states.pop(); - lBraceCount = state.lBraceCount; - yybegin(state.state); - } - - - _JetLexer(java.io.Reader in) { - this.zzReader = in; - } - - /** - * Creates a new scanner. - * There is also java.io.Reader version of this constructor. - * - * @param in the java.io.Inputstream to read input from. - */ - _JetLexer(java.io.InputStream in) { - this(new java.io.InputStreamReader(in)); - } - - /** - * Unpacks the compressed character translation table. - * - * @param packed the packed character translation table - * @return the unpacked character translation table - */ - private static char [] zzUnpackCMap(String packed) { - char [] map = new char[0x10000]; - int i = 0; /* index in packed string */ - int j = 0; /* index in unpacked array */ - while (i < 1326) { - int count = packed.charAt(i++); - char value = packed.charAt(i++); - do map[j++] = value; while (--count > 0); - } - return map; - } - - public final int getTokenStart(){ - return zzStartRead; - } - - public final int getTokenEnd(){ - return getTokenStart() + yylength(); - } - - public void reset(CharSequence buffer, int start, int end,int initialState){ - zzBuffer = buffer; - zzBufferArray = com.intellij.util.text.CharArrayUtil.fromSequenceWithoutCopying(buffer); - zzCurrentPos = zzMarkedPos = zzStartRead = start; - zzPushbackPos = 0; - zzAtEOF = false; - zzAtBOL = true; - zzEndRead = end; - yybegin(initialState); - } - - /** - * Refills the input buffer. - * - * @return false, iff there was new input. - * - * @exception java.io.IOException if any I/O-Error occurs - */ - private boolean zzRefill() throws java.io.IOException { - return true; - } - - - /** - * Returns the current lexical state. - */ - public final int yystate() { - return zzLexicalState; - } - - - /** - * Enters a new lexical state - * - * @param newState the new lexical state - */ - public final void yybegin(int newState) { - zzLexicalState = newState; - } - - - /** - * Returns the text matched by the current regular expression. - */ - public final CharSequence yytext() { - return zzBuffer.subSequence(zzStartRead, zzMarkedPos); - } - - - /** - * Returns the character at position pos from the - * matched text. - * - * It is equivalent to yytext().charAt(pos), but faster - * - * @param pos the position of the character to fetch. - * A value from 0 to yylength()-1. - * - * @return the character at position pos - */ - public final char yycharat(int pos) { - return zzBufferArray != null ? zzBufferArray[zzStartRead+pos]:zzBuffer.charAt(zzStartRead+pos); - } - - - /** - * Returns the length of the matched text region. - */ - public final int yylength() { - return zzMarkedPos-zzStartRead; - } - - - /** - * Reports an error that occured while scanning. - * - * In a wellformed scanner (no or only correct usage of - * yypushback(int) and a match-all fallback rule) this method - * will only be called with things that "Can't Possibly Happen". - * If this method is called, something is seriously wrong - * (e.g. a JFlex bug producing a faulty scanner etc.). - * - * Usual syntax/scanner level error handling should be done - * in error fallback rules. - * - * @param errorCode the code of the errormessage to display - */ - private void zzScanError(int errorCode) { - String message; - try { - message = ZZ_ERROR_MSG[errorCode]; - } - catch (ArrayIndexOutOfBoundsException e) { - message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; - } - - throw new Error(message); - } - - - /** - * Pushes the specified amount of characters back into the input stream. - * - * They will be read again by then next call of the scanning method - * - * @param number the number of characters to be read again. - * This number must not be greater than yylength()! - */ - public void yypushback(int number) { - if ( number > yylength() ) - zzScanError(ZZ_PUSHBACK_2BIG); - - zzMarkedPos -= number; - } - - - /** - * Contains user EOF-code, which will be executed exactly once, - * when the end of file is reached - */ - private void zzDoEOF() { - if (!zzEOFDone) { - zzEOFDone = true; - - } - } - - - /** - * Resumes scanning until the next regular expression is matched, - * the end of input is encountered or an I/O-Error occurs. - * - * @return the next token - * @exception java.io.IOException if any I/O-Error occurs - */ - public IElementType advance() throws java.io.IOException { - int zzInput; - int zzAction; - - // cached fields: - int zzCurrentPosL; - int zzMarkedPosL; - int zzEndReadL = zzEndRead; - CharSequence zzBufferL = zzBuffer; - char[] zzBufferArrayL = zzBufferArray; - char [] zzCMapL = ZZ_CMAP; - - int [] zzTransL = ZZ_TRANS; - int [] zzRowMapL = ZZ_ROWMAP; - int [] zzAttrL = ZZ_ATTRIBUTE; - - while (true) { - zzMarkedPosL = zzMarkedPos; - - zzAction = -1; - - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - - zzState = ZZ_LEXSTATE[zzLexicalState]; - - - zzForAction: { - while (true) { - - if (zzCurrentPosL < zzEndReadL) - zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++); - else if (zzAtEOF) { - zzInput = YYEOF; - break zzForAction; - } - else { - // store back cached positions - zzCurrentPos = zzCurrentPosL; - zzMarkedPos = zzMarkedPosL; - boolean eof = zzRefill(); - // get translated positions and possibly new buffer - zzCurrentPosL = zzCurrentPos; - zzMarkedPosL = zzMarkedPos; - zzBufferL = zzBuffer; - zzEndReadL = zzEndRead; - if (eof) { - zzInput = YYEOF; - break zzForAction; - } - else { - zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++); - } - } - int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; - if (zzNext == -1) break zzForAction; - zzState = zzNext; - - int zzAttributes = zzAttrL[zzState]; - if ( (zzAttributes & 1) == 1 ) { - zzAction = zzState; - zzMarkedPosL = zzCurrentPosL; - if ( (zzAttributes & 8) == 8 ) break zzForAction; - } - - } - } - - // store back cached position - zzMarkedPos = zzMarkedPosL; - - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 3: - { return JetTokens.IDENTIFIER; - } - case 98: break; - case 11: - { pushState(STRING); return JetTokens.OPEN_QUOTE; - } - case 99: break; - case 71: - { return JetTokens.FOR_KEYWORD ; - } - case 100: break; - case 95: - { return JetTokens.RETURN_KEYWORD ; - } - case 101: break; - case 81: - { return JetTokens.NULL_KEYWORD ; - } - case 102: break; - case 34: - { if (lBraceCount == 0) { - popState(); - return JetTokens.LONG_TEMPLATE_ENTRY_END; - } - lBraceCount--; - return JetTokens.RBRACE; - } - case 103: break; - case 18: - { return JetTokens.LT ; - } - case 104: break; - case 51: - { return JetTokens.DO_KEYWORD ; - } - case 105: break; - case 17: - { return JetTokens.PLUS ; - } - case 106: break; - case 67: - { return JetTokens.RAW_STRING_LITERAL; - } - case 107: break; - case 55: - { return JetTokens.PLUSEQ ; - } - case 108: break; - case 86: - { popState(); return JetTokens.THIS_KEYWORD; - } - case 109: break; - case 27: - { return JetTokens.COMMA ; - } - case 110: break; - case 19: - { return JetTokens.GT ; - } - case 111: break; - case 4: - { return JetTokens.WHITE_SPACE; - } - case 112: break; - case 24: - { return JetTokens.RPAR ; - } - case 113: break; - case 54: - { return JetTokens.DOUBLE_ARROW; - } - case 114: break; - case 79: - { return JetTokens.TRUE_KEYWORD ; - } - case 115: break; - case 36: - { return JetTokens.FIELD_IDENTIFIER; - } - case 116: break; - case 59: - { return JetTokens.ANDAND ; - } - case 117: break; - case 63: - { pushState(LONG_TEMPLATE_ENTRY); return JetTokens.LONG_TEMPLATE_ENTRY_START; - } - case 118: break; - case 66: - { return JetTokens.DOC_COMMENT; - } - case 119: break; - case 35: - { return JetTokens.FLOAT_LITERAL; - } - case 120: break; - case 39: - { return JetTokens.EOL_COMMENT; - } - case 121: break; - case 83: - { return JetTokens.WHEN_KEYWORD ; - } - case 122: break; - case 25: - { return JetTokens.COLON ; - } - case 123: break; - case 57: - { return JetTokens.LTEQ ; - } - case 124: break; - case 46: - { return JetTokens.ARROW ; - } - case 125: break; - case 32: - { popState(); return JetTokens.IDENTIFIER; - } - case 126: break; - case 21: - { return JetTokens.LBRACKET ; - } - case 127: break; - case 65: - { yypushback(2); return JetTokens.INTEGER_LITERAL; - } - case 128: break; - case 10: - { return JetTokens.CHARACTER_LITERAL; - } - case 129: break; - case 72: - { return JetTokens.VAR_KEYWORD ; - } - case 130: break; - case 58: - { return JetTokens.GTEQ ; - } - case 131: break; - case 2: - { return JetTokens.INTEGER_LITERAL; - } - case 132: break; - case 13: - { return JetTokens.RBRACE ; - } - case 133: break; - case 90: - { return JetTokens.CLASS_KEYWORD ; - } - case 134: break; - case 14: - { return JetTokens.EXCL ; - } - case 135: break; - case 68: - { return JetTokens.TRY_KEYWORD ; - } - case 136: break; - case 52: - { return JetTokens.EXCLEQ ; - } - case 137: break; - case 45: - { return JetTokens.MINUSEQ ; - } - case 138: break; - case 87: - { return JetTokens.THROW_KEYWORD ; - } - case 139: break; - case 89: - { return JetTokens.SUPER_KEYWORD ; - } - case 140: break; - case 92: - { return JetTokens.WHILE_KEYWORD ; - } - case 141: break; - case 44: - { return JetTokens.MINUSMINUS; - } - case 142: break; - case 97: - { return JetTokens.CONTINUE_KEYWORD ; - } - case 143: break; - case 75: - { return JetTokens.NOT_IN; - } - case 144: break; - case 38: - { return JetTokens.ATAT ; - } - case 145: break; - case 6: - { return JetTokens.DIV ; - } - case 146: break; - case 37: - { return JetTokens.LABEL_IDENTIFIER; - } - case 147: break; - case 29: - { return JetTokens.REGULAR_STRING_PART; - } - case 148: break; - case 16: - { return JetTokens.QUEST ; - } - case 149: break; - case 60: - { return JetTokens.OROR ; - } - case 150: break; - case 20: - { return JetTokens.PERC ; - } - case 151: break; - case 76: - { return JetTokens.EXCLEQEQEQ; - } - case 152: break; - case 61: - { return JetTokens.PERCEQ ; - } - case 153: break; - case 43: - { return JetTokens.RANGE ; - } - case 154: break; - case 1: - { return TokenType.BAD_CHARACTER; - } - case 155: break; - case 96: - { return JetTokens.NAMESPACE_KEYWORD ; - } - case 156: break; - case 74: - { return JetTokens.NOT_IS; - } - case 157: break; - case 7: - { return JetTokens.MUL ; - } - case 158: break; - case 22: - { return JetTokens.RBRACKET ; - } - case 159: break; - case 56: - { return JetTokens.PLUSPLUS ; - } - case 160: break; - case 78: - { return JetTokens.THIS_KEYWORD ; - } - case 161: break; - case 8: - { return JetTokens.DOT ; - } - case 162: break; - case 26: - { return JetTokens.SEMICOLON ; - } - case 163: break; - case 49: - { return JetTokens.IF_KEYWORD ; - } - case 164: break; - case 64: - { return JetTokens.ESCAPE_SEQUENCE; - } - case 165: break; - case 31: - { popState(); return JetTokens.CLOSING_QUOTE; - } - case 166: break; - case 15: - { return JetTokens.EQ ; - } - case 167: break; - case 5: - { return JetTokens.AT ; - } - case 168: break; - case 69: - { return JetTokens.AS_SAFE; - } - case 169: break; - case 23: - { return JetTokens.LPAR ; - } - case 170: break; - case 9: - { return JetTokens.MINUS ; - } - case 171: break; - case 93: - { return JetTokens.FALSE_KEYWORD ; - } - case 172: break; - case 80: - { return JetTokens.TYPE_KEYWORD ; - } - case 173: break; - case 70: - { return JetTokens.FUN_KEYWORD ; - } - case 174: break; - case 47: - { return JetTokens.IS_KEYWORD ; - } - case 175: break; - case 30: - { popState(); yypushback(1); return JetTokens.DANGLING_NEWLINE; - } - case 176: break; - case 33: - { lBraceCount++; return JetTokens.LBRACE; - } - case 177: break; - case 85: - { yypushback(3); return JetTokens.EXCL; - } - case 178: break; - case 41: - { return JetTokens.DIVEQ ; - } - case 179: break; - case 82: - { return JetTokens.ELSE_KEYWORD ; - } - case 180: break; - case 50: - { return JetTokens.AS_KEYWORD ; - } - case 181: break; - case 48: - { return JetTokens.IN_KEYWORD ; - } - case 182: break; - case 53: - { return JetTokens.EQEQ ; - } - case 183: break; - case 77: - { return JetTokens.EQEQEQ ; - } - case 184: break; - case 73: - { return JetTokens.VAL_KEYWORD ; - } - case 185: break; - case 84: - { return JetTokens.CAPITALIZED_THIS_KEYWORD ; - } - case 186: break; - case 42: - { return JetTokens.MULTEQ ; - } - case 187: break; - case 62: - { pushState(SHORT_TEMPLATE_ENTRY); - yypushback(yylength() - 1); - return JetTokens.SHORT_TEMPLATE_ENTRY_START; - } - case 188: break; - case 12: - { return JetTokens.LBRACE ; - } - case 189: break; - case 94: - { return JetTokens.OBJECT_KEYWORD ; - } - case 190: break; - case 91: - { return JetTokens.BREAK_KEYWORD ; - } - case 191: break; - case 40: - { return JetTokens.BLOCK_COMMENT; - } - case 192: break; - case 88: - { return JetTokens.TRAIT_KEYWORD ; - } - case 193: break; - case 28: - { return JetTokens.HASH ; - } - case 194: break; - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - zzDoEOF(); - return null; - } - else { - zzScanError(ZZ_NO_MATCH); - } - } - } - } - - -} diff --git a/confluence/src/main/resources/atlassian-plugin.xml b/confluence/src/main/resources/atlassian-plugin.xml deleted file mode 100644 index e5253849327..00000000000 --- a/confluence/src/main/resources/atlassian-plugin.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - ${project.description} - ${project.version} - - - - - Highlighting for Kotlin language - - - Highlighting for Kotlin language - - - -      -      - - diff --git a/confluence/src/main/resources/kotlin.css b/confluence/src/main/resources/kotlin.css deleted file mode 100644 index c63d0d60613..00000000000 --- a/confluence/src/main/resources/kotlin.css +++ /dev/null @@ -1,70 +0,0 @@ -.jet { - white-space: pre; - display: inline; -} - -.jet.keyword { - font-weight: bold; - color: #369; -} - -.jet.softkeyword { - color: #369; -} - -.jet.jet-comment { - color : green; - -} - -.jet.number { - color : blue; -} -.jet.string { - color : #000099; -} -.jet.escape { - font-weight: bold; - color : black; -} -.jet.label { - color : blue; -} -.jet.field { - color : blue; - font-weight: bold; -} -.jet.bad { - background-color : #FF9999; - color:black; -} -.jet.error { - background: url(underline.gif) bottom repeat-x; - display:inline; -} -.jet.warning { - background-color : #f5eabb; - display:inline; -} -.jet.unresolved { - color : red; - display:inline; -} - -.jet.herror { - background-color: #FFAAAA; -} -.jet.hwarning { - background-color: #FFAAAA; - display:inline; -} - -.jet.ref:link { color: black; } -.jet.ref:visited { color: black; } -.jet.ref:hover { color:blue; text-decoration:underline; } -.jet.ref:active { color:blue; text-decoration:underline; } - -.jet.anchor:link { } -.jet.anchor:visited { } -.jet.anchor:hover { color:blue; text-decoration:underline; } -.jet.anchor:active { color:blue; text-decoration:underline; } diff --git a/confluence/src/main/resources/template.velocity b/confluence/src/main/resources/template.velocity deleted file mode 100644 index 8f0d70fe3cb..00000000000 --- a/confluence/src/main/resources/template.velocity +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/confluence/src/main/resources/underline.gif b/confluence/src/main/resources/underline.gif deleted file mode 100644 index b18243e7834..00000000000 Binary files a/confluence/src/main/resources/underline.gif and /dev/null differ diff --git a/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolwindow.java b/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolwindow.java index 6cf342f93da..d674edd60e0 100644 --- a/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolwindow.java +++ b/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolwindow.java @@ -194,7 +194,7 @@ public class ResolveToolwindow extends JPanel implements Disposable { if (debugInfo != null) { List> resolutionTasks = debugInfo.get(TASKS); for (ResolutionTask resolutionTask : resolutionTasks) { - for (ResolvedCallImpl resolvedCall : resolutionTask.getCandidates()) { + for (ResolvedCallImpl resolvedCall : resolutionTask.getResolvedCallMap().values()) { renderResolutionLogForCall(debugInfo, resolvedCall, result); } } diff --git a/injector-generator/src/org/jetbrains/jet/di/AllInjectorsGenerator.java b/injector-generator/src/org/jetbrains/jet/di/AllInjectorsGenerator.java index ccf3d1e2420..4ab6505c257 100644 --- a/injector-generator/src/org/jetbrains/jet/di/AllInjectorsGenerator.java +++ b/injector-generator/src/org/jetbrains/jet/di/AllInjectorsGenerator.java @@ -18,6 +18,7 @@ package org.jetbrains.jet.di; import com.intellij.openapi.project.Project; import org.jetbrains.jet.codegen.ClassBuilderFactory; +import org.jetbrains.jet.codegen.ClassBuilderMode; import org.jetbrains.jet.codegen.ClassFileFactory; import org.jetbrains.jet.codegen.GenerationState; import org.jetbrains.jet.codegen.JetTypeMapper; @@ -149,6 +150,7 @@ public class AllInjectorsGenerator { generator.addParameter(DiType.listOf(JetFile.class)); generator.addParameter(Project.class); generator.addParameter(CompilerSpecialMode.class); + generator.addParameter(ClassBuilderMode.class); generator.addPublicParameter(GenerationState.class); generator.addParameter(ClassBuilderFactory.class); generator.addPublicField(JetTypeMapper.class); @@ -164,6 +166,7 @@ public class AllInjectorsGenerator { generator.addParameter(DiType.listOf(JetFile.class)); generator.addPublicField(JetTypeMapper.class); generator.addField(CompilerSpecialMode.REGULAR); + generator.addField(ClassBuilderMode.FULL); generator.generate("compiler/backend/src", "org.jetbrains.jet.di", "InjectorForJetTypeMapper"); } diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java b/js/js.translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java index 0955dc23522..85a09258840 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java @@ -21,6 +21,7 @@ import com.google.dart.compiler.backend.js.ast.JsExpression; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.CallableDescriptor; +import org.jetbrains.jet.lang.resolve.calls.ResolutionCandidate; import org.jetbrains.jet.lang.resolve.calls.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.ResolvedCallImpl; import org.jetbrains.k2js.translate.context.TranslationContext; @@ -103,7 +104,7 @@ public final class CallBuilder { private CallTranslator finish() { if (resolvedCall == null) { assert descriptor != null; - resolvedCall = ResolvedCallImpl.create(descriptor); + resolvedCall = ResolvedCallImpl.create(ResolutionCandidate.create(descriptor)); } if (descriptor == null) { descriptor = resolvedCall.getCandidateDescriptor().getOriginal(); diff --git a/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt b/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt index 565a7a25a62..a4256f29f55 100644 --- a/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt +++ b/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt @@ -4,7 +4,7 @@ import java.io.File import java.io.PrintStream import org.jetbrains.jet.cli.CompilerArguments import org.jetbrains.jet.cli.KotlinCompiler -import org.jetbrains.jet.compiler.CompileEnvironment +import org.jetbrains.jet.compiler.CompileEnvironmentConfiguration import org.jetbrains.kotlin.doc.highlighter.HtmlCompilerPlugin /** @@ -20,16 +20,16 @@ fun main(args: Array): Unit { */ class KDocCompiler() : KotlinCompiler() { - protected override fun configureEnvironment(environment : CompileEnvironment?, arguments : CompilerArguments?) { - super.configureEnvironment(environment, arguments) - val coreEnvironment = environment?.getEnvironment() + protected override fun configureEnvironment(configuration : CompileEnvironmentConfiguration?, arguments : CompilerArguments?) { + super.configureEnvironment(configuration, arguments) + val coreEnvironment = configuration?.getEnvironment() if (coreEnvironment != null) { val kdoc = KDoc() if (arguments is KDocArguments) { kdoc.config = arguments.apply() } - val plugins = coreEnvironment.getCompilerPlugins().orEmpty() + val plugins = configuration?.getCompilerPlugins().orEmpty() /* val sourcePlugin = HtmlCompilerPlugin() plugins.add(sourcePlugin)