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

Support for imports #72

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Support for imports #72

wants to merge 4 commits into from

Conversation

Leosimetti
Copy link
Contributor

@Leosimetti Leosimetti commented Jun 13, 2022

This PR introduces a new interface with support for imports (analyzeSourceCodeDir) for analyzing multiple files.

Import Definition

In EO, imports refer to the following constructs at the top of the file:
+alias bndAlias pkgName.bndSrc
Each import consists of three parts:

  1. Optional alias - bndAlias (binding name can be changed when its imported);
  2. Optional package name - pkgName (packageless objects are stored are a part of the global package with no name);
  3. Path to the imported binding -bndSrc (can be either a top-level object or a path to some nested binding).

Supported Functionality

The following import functionality is currently supported:

  • Importing of packageless bindings
    +alias objName
    +alias objName.pathToNestedBnd

  • Importing of bindings with package
    +alias pkgName.srcPath

  • Aliasing in Imports
    +alias name pkgName.srcPath

  • Sharing of top-level objects within the same package
    File1:

    +package pkg
    [] > a
    

    File2:

    +package pkg
    [] > b
      a > @
    

Unsupported Features

The following is NOT supported:

  • Recursive import fetching (imports of imports)
    Notice how object a is also added to File3
    File1:
    +package pkg1
    [] > a
    
    File2:
    +package pkg2
    +alias pkg1.a 
    [] > b
      a > @
    
    File3:
    +alias pkg2.b
    [] > c
      a > @
    [] > d
      b > @
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant