Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Introducing support for imports without the alias #44

Merged
merged 7 commits into from
May 15, 2022

Conversation

Leosimetti
Copy link
Contributor

@Leosimetti Leosimetti commented Mar 25, 2022

In this PR, imports refer to such constructs in EO:

+alias print org.eolang.txt.sprintf

or

+alias org.eolang.txt.sprintf

The functionality of the following modules has been updated to support imports without aliases:

1. Parser

Now can identify imporys without aliases. For example, "+alias org.eolang.txt.sprintf".

2. AST

The ast node EOAliasMeta has been changed to

sealed case class EOAliasMeta(
  alias: Option[String],
  src: NonEmptyList[String],
) extends EOMeta

3. Pretty-printer

Now supports pretty-printing of import without aliases like "+alias org.eolang.txt.sprintf".

4. Context (setting locators)

Meta-aliases are added to the initial context that the algorithm references to get locator information.
Some common imported keywords were removed from predef (EO keywords that are recognized when setting locators).

5. Tests

Testcases related to aliases in Parser were updated according to the made changes.
Added testcases for setting locators in the presence of EO-keywords and aliases.

This PR closes #15

Leosimetti and others added 4 commits March 25, 2022 17:01
Changes affect parser, EOAST, pretty-printer, and related tests.

Co-Authored-By: Mihail Olokin <45356788+nikololiahim@users.noreply.github.com>
… account

Predef was move up in the source file for the ease of modification.
Meta-aliases are added to the initial context that the algorithm references to get locator information.
The removed keywords need to be imported before use, as such it is unreasonable to include them in predef
@Leosimetti Leosimetti changed the title Introducing support for aliases (imports) Introducing support for imports without the alias Mar 25, 2022
@nikololiahim nikololiahim self-requested a review May 15, 2022 09:58
@nikololiahim nikololiahim merged commit b35e02e into master May 15, 2022
@nikololiahim nikololiahim deleted the introducing_suuport_for_aliases branch May 15, 2022 18:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parser fails to recognize a kind of alias meta
2 participants