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

feat(compiler): bring local wing files #252

Merged
merged 45 commits into from
Oct 31, 2022
Merged

feat(compiler): bring local wing files #252

merged 45 commits into from
Oct 31, 2022

Conversation

3p3r
Copy link
Contributor

@3p3r 3p3r commented Oct 11, 2022

This PR does a re-implementation of my previous PR to bring local Wing files.
context: #208

  • behavior of circular imports and re-importing the same files needs deeper discussion, currently it blindly emits empty statements if it encounters a circular import.
  • investigate merge of Use and Bring statements at AST level (parser.rs).
  • instead of emitting empty statements, build_statement should return an Option or maybe an EmptyStatement in AST.
  • tests for the circular bring behavior whenever it's decided and finalized.

Huge props to @yoav-steinberg for the pairing session.

yoav-steinberg and others added 15 commits September 22, 2022 14:51
Merge jsii resource clients into generate wing resources.
Handle JSII Void return types as no return type in wing.
* Added support fro `struct`s in parser/type_checker/jsification.
* Import constructors (including skipping scope/id on resources).
* Pass "self" argument to imported class methods.
* refactor: moved jsii importing logic into submodule under a new type_check module.
* resolve namespaced custom types in type checker.
* corretly handle parent resource in resource type checking.
* JSII imported handles references to other JSII types (not only primitives).
* Also added support for multiple struct inheritance in when importing JSII props.
* Support importing wingsdk `Duration` types.
also:
Cleaned up method_call vs function_call in grammar/ast
Fixed return type parsing
* Updated sdk_capture tests to use explicit Props ars used by sdk resources.
* Support type annotation in container literals.
* Added map literals support.
* de-dup captured method names in capture mechanism.
* removed auto capturing of everything looking like a mehtod call on an anything object (AKA wingsdk support hack).
Co-authored-by: Chris Rybicki <chrisr@monada.co>
@3p3r
Copy link
Contributor Author

3p3r commented Oct 11, 2022

This needs to be merged after #242 is merged. It's branched off Yoav's branch.

yoav-steinberg and others added 12 commits October 12, 2022 10:49
Also:
* Fix inflight.w example based on real imported cloud.Bucket type.
* Removed skipping type checking on `new` expressions when the type is resolved to an `Anything`, we don't expect custom types to be `Anything`'s anymore.
This was there because we didn't really know the type of the `new` expression. Now the type is available through a the `Expr.evaluated_type`.
Co-authored-by: Elad Ben-Israel <elad.benisrael@gmail.com>
@3p3r 3p3r self-assigned this Oct 20, 2022
@3p3r 3p3r added the 🛠️ compiler Compiler label Oct 20, 2022
@3p3r 3p3r added this to the MVP-1 milestone Oct 20, 2022
@3p3r 3p3r linked an issue Oct 20, 2022 that may be closed by this pull request
@staycoolcall911
Copy link
Contributor

Hey @3p3r, what's the status of this? Can it be merged to main?

@3p3r
Copy link
Contributor Author

3p3r commented Oct 26, 2022

@staycoolcall911 this looks good to me. I merged main into it. It's pending @yoav-steinberg 's review.

@3p3r 3p3r changed the title feat(wingc): bring local wing files feat(compiler): bring local wing files Oct 26, 2022
Copy link
Contributor

@yoav-steinberg yoav-steinberg left a comment

Choose a reason for hiding this comment

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

Thumbs up 👍
But I'd like you to open issues for unfulfilled tasks in the top description. And also an additional issue for getting bring to import into a Namespace (Add an optional name field to the AST's scope as a Namespace in our type system).

@3p3r 3p3r enabled auto-merge (squash) October 31, 2022 17:46
@3p3r 3p3r merged commit 05fb820 into main Oct 31, 2022
@3p3r 3p3r deleted the sep/wing_import branch October 31, 2022 17:58
3p3r added a commit that referenced this pull request Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple .w files in a a Wing program
5 participants