-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow local modules to be forward referenced #3275
Merged
Merged
Conversation
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
3955598
to
d60b482
Compare
43907c0
to
69fbfcc
Compare
aa57f5d
to
f9359ec
Compare
Q: What needs to change in https://github.com/anoma/nspec to be compatible with this PR? |
f9359ec
to
9e6cab2
Compare
|
9e6cab2
to
4b00228
Compare
lukaszcz
approved these changes
Jan 28, 2025
janmasrovira
added a commit
to anoma/juvix-stdlib
that referenced
this pull request
Jan 29, 2025
- This should be merged after anoma/juvix#3275 is merged into Juvix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr makes a number of changes to the Scoper. The most important change is that local modules can be forward referenced. Below I list all the changes.
Referencing local modules
Local modules can now be forward referenced. However, there is one restriction:
open public
are not yet in scope, so they can't be referenced. E.g.Forward reference passed an import, open or module statement
The following example was not allowed but now it is.
Changes in operators and iteratos
The semantics of operator and iterator definitions have changed slightly. Before, when the scoper found
syntax operator , pair
, it would remember in the state that when the,
symbol is defined in the current syntax block, it should have the fixitypair
. These had some implications.,
symbol in thesyntax operator , pair
is not highlighted and it doesn't support going to definition.The new behaviour is as follows.
syntax operator , pair
, the symbol,
is scoped using the regular scoping rules - so,
must be in scope. Then, the scoper modifies the fixity for,
in the current scope.syntax operator Pair., pair
.Because of point 1) we might encounter some breaking changes.
mkpair
is not in scope in thesyntax operator
statement, because aliases cannot be forward referenced.
syntax operator op fix
will now throw an ambiguity error ifop
is both defined in this module and imported from somewhere else.Qualified fixities
It is now possible to reference fixities using qualified names. E.g.
Pending tasks