Revert misleading whitespace changes.

This commit is contained in:
Pavel V. Talanov
2012-04-09 15:04:27 +04:00
parent 62efa95211
commit 652be4ed95
7 changed files with 73 additions and 98 deletions
@@ -54,18 +54,12 @@ public class GenerationState {
this(project, builderFactory, Progress.DEAF, analyzeExhaust, files);
}
public GenerationState(Project project,
ClassBuilderFactory builderFactory,
Progress progress,
@NotNull AnalyzeExhaust exhaust,
@NotNull List<JetFile> files) {
public GenerationState(Project project, ClassBuilderFactory builderFactory, Progress progress, @NotNull AnalyzeExhaust exhaust, @NotNull List<JetFile> files) {
this.project = project;
this.progress = progress;
this.analyzeExhaust = exhaust;
this.files = files;
this.injector =
new InjectorForJvmCodegen(analyzeExhaust.getStandardLibrary(), analyzeExhaust.getBindingContext(), this.files, project, this,
builderFactory);
this.injector = new InjectorForJvmCodegen(analyzeExhaust.getStandardLibrary(), analyzeExhaust.getBindingContext(), this.files, project, this, builderFactory);
}
@NotNull
@@ -90,13 +84,11 @@ public class GenerationState {
}
public ClassBuilder forClassImplementation(ClassDescriptor aClass) {
return getFactory().newVisitor(
getInjector().getJetTypeMapper().mapType(aClass.getDefaultType(), OwnerKind.IMPLEMENTATION).getInternalName() + ".class");
return getFactory().newVisitor(getInjector().getJetTypeMapper().mapType(aClass.getDefaultType(), OwnerKind.IMPLEMENTATION).getInternalName() + ".class");
}
public ClassBuilder forTraitImplementation(ClassDescriptor aClass) {
return getFactory().newVisitor(
getInjector().getJetTypeMapper().mapType(aClass.getDefaultType(), OwnerKind.TRAIT_IMPL).getInternalName() + ".class");
return getFactory().newVisitor(getInjector().getJetTypeMapper().mapType(aClass.getDefaultType(), OwnerKind.TRAIT_IMPL).getInternalName() + ".class");
}
public Pair<String, ClassBuilder> forAnonymousSubclass(JetExpression expression) {
@@ -142,17 +134,14 @@ public class GenerationState {
closure.cv = nameAndVisitor.getSecond();
closure.name = nameAndVisitor.getFirst();
final CodegenContext objectContext = closure.context.intoAnonymousClass(
closure, analyzeExhaust.getBindingContext().get(BindingContext.CLASS, objectDeclaration), OwnerKind.IMPLEMENTATION,
injector.getJetTypeMapper());
closure, analyzeExhaust.getBindingContext().get(BindingContext.CLASS, objectDeclaration), OwnerKind.IMPLEMENTATION, injector.getJetTypeMapper());
new ImplementationBodyCodegen(objectDeclaration, objectContext, nameAndVisitor.getSecond(), this).generate();
ConstructorDescriptor constructorDescriptor = analyzeExhaust.getBindingContext().get(BindingContext.CONSTRUCTOR, objectDeclaration);
CallableMethod callableMethod = injector.getJetTypeMapper().mapToCallableMethod(
constructorDescriptor, OwnerKind.IMPLEMENTATION,
injector.getJetTypeMapper().hasThis0(constructorDescriptor.getContainingDeclaration()));
return new GeneratedAnonymousClassDescriptor(nameAndVisitor.first, callableMethod.getSignature().getAsmMethod(),
objectContext.outerWasUsed, null);
constructorDescriptor, OwnerKind.IMPLEMENTATION, injector.getJetTypeMapper().hasThis0(constructorDescriptor.getContainingDeclaration()));
return new GeneratedAnonymousClassDescriptor(nameAndVisitor.first, callableMethod.getSignature().getAsmMethod(), objectContext.outerWasUsed, null);
}
public String createText() {
@@ -162,8 +151,8 @@ public class GenerationState {
List<String> files = factory.files();
for (String file : files) {
// if (!file.startsWith("kotlin/")) {
answer.append("@").append(file).append('\n');
answer.append(factory.asText(file));
answer.append("@").append(file).append('\n');
answer.append(factory.asText(file));
// }
}
@@ -34,11 +34,11 @@ public class GenerationUtils {
}
public static GenerationState compileFileGetGenerationState(JetFile psiFile) {
final AnalyzeExhaust analyzeExhaust =
AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegrationAndCheckForErrors(psiFile, JetControlFlowDataTraceFactory.EMPTY);
GenerationState state = new GenerationState(psiFile.getProject(), ClassBuilderFactories.binaries(false), analyzeExhaust,
Collections.singletonList(psiFile));
final AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegrationAndCheckForErrors(psiFile, JetControlFlowDataTraceFactory.EMPTY);
GenerationState state = new GenerationState(psiFile.getProject(), ClassBuilderFactories.binaries(false),
analyzeExhaust, Collections.singletonList(psiFile));
state.compileCorrectFiles(CompilationErrorHandler.THROW_EXCEPTION);
return state;
}
}