-
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
Open
janmasrovira
wants to merge
36
commits into
main
Choose a base branch
from
local-modules-forward-reference
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
janmasrovira
force-pushed
the
local-modules-forward-reference
branch
2 times, most recently
from
January 16, 2025 20:59
3955598
to
d60b482
Compare
janmasrovira
force-pushed
the
local-modules-forward-reference
branch
from
January 23, 2025 08:51
43907c0
to
69fbfcc
Compare
janmasrovira
force-pushed
the
local-modules-forward-reference
branch
from
January 23, 2025 22:07
368ea2d
to
9e72797
Compare
janmasrovira
force-pushed
the
local-modules-forward-reference
branch
from
January 24, 2025 16:19
d91d131
to
aa57f5d
Compare
janmasrovira
force-pushed
the
local-modules-forward-reference
branch
from
January 24, 2025 16:19
aa57f5d
to
f9359ec
Compare
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