Fix source locations in Enso files (#1208)

This commit is contained in:
Marcin Kostrzewa 2020-10-09 14:45:41 +02:00 committed by GitHub
parent 05f4cc2e7c
commit 2783d5e706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -238,7 +238,7 @@ public class Module implements TruffleObject {
if (source == null) return;
scope.reset();
compilationStage = CompilationStage.INITIAL;
context.getCompiler().run(source, this);
context.getCompiler().run(this);
}
/** @return IR defined by this module. */

View File

@ -44,12 +44,11 @@ class Compiler(val context: Context) {
* Processes the provided language sources, registering any bindings in the
* given scope.
*
* @param source the source code to be processed
* @param module the scope into which new bindings are registered
* @return an interpreter node whose execution corresponds to the top-level
* executable functionality in the module corresponding to `source`.
*/
def run(source: Source, module: Module): Unit = {
def run(module: Module): Unit = {
parseModule(module)
val importedModules = importResolver.mapImports(module)
val requiredModules =
@ -94,7 +93,7 @@ class Compiler(val context: Context) {
Module.CompilationStage.AFTER_CODEGEN
)
) {
truffleCodegen(module.getIr, source, module.getScope)
truffleCodegen(module.getIr, module.getSource, module.getScope)
module.unsafeSetCompilationStage(Module.CompilationStage.AFTER_CODEGEN)
}
}