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

Add Meta.get_annotation #4049

Merged
merged 25 commits into from
Jan 24, 2023
Merged

Add Meta.get_annotation #4049

merged 25 commits into from
Jan 24, 2023

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Jan 13, 2023

Pull Request Description

Changelog:

  • add: GeneralAnnotation IR node for @name expression annotations
  • update: compilation pipeline to process the annotation expressions
  • update: rewrite OverloadsResolution compiler pass so that it keeps the order of module definitions
  • add: Meta.get_annotation builtin function that returns the result of annotation expression
  • misc: improvements (private methods, lazy arguments, build.sbt cleanup)

Important Notes

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run ide build and ./run ide watch.

@4e6 4e6 self-assigned this Jan 13, 2023
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

Looks good. The changes seem to be made at right places. What is still needed for this to be integrated?


"associate module annotations with method definitions" in {
val ir =
"""@a expr_1
Copy link
Member

Choose a reason for hiding this comment

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

Oh no, no new Scala tests, please. There is good enough infrastructure for testing IR in ErrorCompilerTest & co.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Java tests like ErrorCompilerTest are only checking the parsing. This test runs the compilation phases

try compiler.compile(source)
finally compiler.close()
} else {
AstToIr.translate(source.toAst)
Copy link
Member

Choose a reason for hiding this comment

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

Is there any need to test the old AstToIr? The Rust based parser shall deliver good enough results. If not, such a test shall be added to EnsoCompilerTest - that would show the difference and the difference could be eliminated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New parser produces a lot of errors with the compiler test snippets. It will take significant time to go through each case and fix it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This will be problematic soon as we want to ditch it quickly. Please file a separate ticket or (if it exists already) make sure this one is included in the tasks.

build.sbt Show resolved Hide resolved
@4e6 4e6 marked this pull request as ready for review January 23, 2023 10:13
Copy link
Collaborator

@hubertp hubertp left a comment

Choose a reason for hiding this comment

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

nit: s/General/Generic ?

@@ -368,6 +385,7 @@ private List<IR> translateTypeBodyExpressionImpl(Tree exp, List<IR> appendTo) th
var ir = translateTypeSignature(sig, sig.getType(), typeName);
yield cons(ir, appendTo);
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably standardize on that, for now this is rather dev-dependent (I have no opinion regarding the new line itself). Maybe scalafmt can enforce that?

try compiler.compile(source)
finally compiler.close()
} else {
AstToIr.translate(source.toAst)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will be problematic soon as we want to ditch it quickly. Please file a separate ticket or (if it exists already) make sure this one is included in the tasks.

@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Jan 24, 2023
@4e6 4e6 merged commit bf95086 into develop Jan 24, 2023
@4e6 4e6 deleted the wip/db/metadata-for-widgets-182801491 branch January 24, 2023 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants