Refactoring of K2JSTranslator and neighboring classes

Drop GenerationUtils
Introduce MainCallParameters
Generate calls to main function together with the other code in contrast to as text afterwards
Enhance tests a bit
This commit is contained in:
pTalanov
2012-05-05 18:50:02 +04:00
parent 9681a61fd2
commit 869a8ab1ba
12 changed files with 210 additions and 149 deletions
@@ -93,8 +93,8 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments, K2JSCompile
private static ExitCode translateAndGenerateOutputFile(@NotNull PrintingMessageCollector messageCollector,
@NotNull JetCoreEnvironment environmentForJS, @NotNull Config config, @NotNull String outputFile) {
try {
K2JSTranslator.translateWithCallToMainAndSaveToFile(environmentForJS.getSourceFiles(), outputFile, config,
environmentForJS.getProject());
K2JSTranslator.translateWithCallToMainAndSaveToFile(environmentForJS.getSourceFiles(), outputFile, config
);
}
catch (Exception e) {
messageCollector.report(CompilerMessageSeverity.ERROR, "Exception while translating:\n" + e.getMessage(),