Skip to content
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

Generalize import syntax #2819

Merged
merged 20 commits into from
Jun 21, 2024
Merged

Generalize import syntax #2819

merged 20 commits into from
Jun 21, 2024

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Jun 8, 2024

This pr introduces two enchancements to import statements:

  1. They can have using/hiding list of symbols, with a behaviour analogous to the open statement.
  2. They can be public. When an import is marked as public, a local module (or a series of nested local modules) is generated like this:
     import A public;
     -- equivalent to
     import A;
     module A;
       open A public;
     end;
    
    It is easier to understand when there is an alias.
    import A as X.Y public;
    -- equivalent to
    import A;
    module X;
      module Y;
        open A public;
      end;
    end;
    
    Public imports are allowed to be combined with using/hiding modifier and open statements with the expected behaviour.

@janmasrovira janmasrovira added enhancement New feature or request modules labels Jun 8, 2024
@janmasrovira janmasrovira self-assigned this Jun 8, 2024
@janmasrovira janmasrovira linked an issue Jun 8, 2024 that may be closed by this pull request
@janmasrovira janmasrovira changed the title Add suport for `import A as B public; Add suport for import A as B public Jun 8, 2024
@janmasrovira janmasrovira changed the title Add suport for import A as B public Add suport for import A public and import A as B public Jun 8, 2024
@janmasrovira janmasrovira changed the title Add suport for import A public and import A as B public Generalize import syntax Jun 8, 2024
@janmasrovira janmasrovira force-pushed the 2429-public-qualified-import branch 4 times, most recently from 25d0e5a to 2d92db1 Compare June 20, 2024 20:02
@janmasrovira janmasrovira marked this pull request as ready for review June 21, 2024 09:39
@@ -1,55 +0,0 @@
module DefaultValues;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this test removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no test that used this file. It was basically an isolated file, so I removed it

@lukaszcz lukaszcz force-pushed the 2429-public-qualified-import branch from dee113d to 90e2789 Compare June 21, 2024 12:03
@janmasrovira janmasrovira merged commit e43797f into main Jun 21, 2024
4 checks passed
@janmasrovira janmasrovira deleted the 2429-public-qualified-import branch June 21, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request modules syntax
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Public qualified import
2 participants