-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support module imports in Juvix REPL (#2029)
This PR adds support for importing modules from within a Juvix project in the Juvix REPL. The imported module is checked (parsed, arity-checked, type-checked etc) as normal and added to the REPL session scope. Any errors during the checking phase is reported to the user. ### Notes: * You must load a file before using `import`. This is because the REPL needs to know which Juvix project is active. * You may only import modules from within the same Juvix project. ### Examples After launching `juvix repl`: #### `open import` ``` Stdlib.Prelude> open import Stdlib.Data.Int.Ord Stdlib.Prelude> 1 == 1 true ``` #### `import as` ``` Stdlib.Prelude> import Stdlib.Data.Int.Ord as Int Stdlib.Prelude> 1 Int.== 1 true ``` #### `import`then `open` ``` Stdlib.Prelude> import Stdlib.Data.Int.Ord as Int Stdlib.Prelude> open Int Stdlib.Prelude> 1 == 1 true ``` #### Line-terminating semicolons are ignored: ``` Stdlib.Prelude> import Stdlib.Data.Int.Ord as Int;;;;; Stdlib.Prelude> 1 Int.== 1 true ``` * Closes #1951 --------- Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no>
- Loading branch information
1 parent
70f27fc
commit 6894300
Showing
18 changed files
with
523 additions
and
144 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
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
Oops, something went wrong.