-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Revert "Import all available libraries in --repl mode (#10746)" This reverts commit 71285e6. * trigger build
- Loading branch information
Showing
14 changed files
with
78 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 0 additions & 57 deletions
57
engine/polyglot-api/src/main/java/org/enso/polyglot/PolyglotContext.java
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
engine/polyglot-api/src/main/scala/org/enso/polyglot/PolyglotContext.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.enso.polyglot | ||
import java.io.File | ||
import org.enso.common.LanguageInfo | ||
|
||
import org.graalvm.polyglot.{Context, Source} | ||
|
||
/** Exposes language specific aliases for generic polyglot context operations. | ||
* @param context the Graal polyglot context to use. | ||
*/ | ||
class PolyglotContext(val context: Context) { | ||
|
||
/** Evaluates provided code string as a new module. | ||
* | ||
* @param code the code to evaluate. | ||
* @param moduleName the name for the newly parsed module. | ||
* @return the module representing evaluated code. | ||
*/ | ||
def evalModule(code: String, moduleName: String): Module = { | ||
val source = Source | ||
.newBuilder(LanguageInfo.ID, code, moduleName) | ||
.build() | ||
new Module(context.eval(source)) | ||
} | ||
|
||
/** Evaluates provided code file as a new module. | ||
* | ||
* @param codeFile the code to evaluate. | ||
* @return the module representing evaluated code. | ||
*/ | ||
def evalModule(codeFile: File): Module = { | ||
val source = Source.newBuilder(LanguageInfo.ID, codeFile).build | ||
new Module(context.eval(source)) | ||
} | ||
|
||
/** @return the top scope of Enso execution context | ||
*/ | ||
def getTopScope: TopScope = { | ||
new TopScope(context.getBindings(LanguageInfo.ID)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
...ntime-integration-tests/src/test/java/org/enso/interpreter/runtime/ListLibrariesTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters