Rantanen / intercom

Object based cross-language FFI for Rust
MIT License
63 stars 7 forks source link

Type systems #77

Closed Rantanen closed 5 years ago

Rantanen commented 6 years ago

PR for implementing the multiple type systems for Automation/Raw interfaces.

I'll drop the "take into use" bits into a different PR so we can get the massive model.rs changes in as quickly as possible to avoid conflicts.

Parameter parsing.

I want things like #[com_interface(..)] attribute to support optional named parameters:

#[com_interface]  // old #[com_interface( AUTO_GUID )]
#[com_interface( com_iid = "{guid...}" )]  // old #[com_interface( "{guid...}" )]
#[com_interface( raw_iid = "{guid...}" )]  // predefined guid for the raw type system interface
#[com_interface( com_impl = Automation )]  // Implements Rust-to-COM calls using Automation types
#[com_interface( type_system = Automation )]  // 
Rantanen commented 6 years ago

This PR also split the model.rs into model/*.rs files. There are some rather massive changes to the model.rs here so I'm trying to avoid conflicts with #73.

The goal is to merge this quickly with just the model changes (and some generation changes) - actual type system implementation (ie. the chanes to tyhandlers) will follow afterwards.

codecov-io commented 6 years ago

Codecov Report

Merging #77 into master will decrease coverage by 0.08%. The diff coverage is 86.19%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #77      +/-   ##
==========================================
- Coverage   73.95%   73.86%   -0.09%     
==========================================
  Files          50       56       +6     
  Lines        3548     3781     +233     
==========================================
+ Hits         2624     2793     +169     
- Misses        924      988      +64
Impacted Files Coverage Δ
intercom-common/src/generators/manifest.rs 69.49% <ø> (ø) :arrow_up:
intercom/src/lib.rs 25% <ø> (ø) :arrow_up:
intercom-common/tests/parse_tests.rs 93.54% <ø> (ø) :arrow_up:
intercom-common/src/model/mod.rs 0% <0%> (ø)
intercom/src/error.rs 13.79% <0%> (ø) :arrow_up:
intercom-common/src/attributes/com_library.rs 0% <0%> (ø) :arrow_up:
intercom-common/src/idents.rs 62.96% <0%> (-7.88%) :arrow_down:
intercom-build/src/os/mod.rs 0% <0%> (ø) :arrow_up:
intercom-cli/src/main.rs 0% <0%> (ø) :arrow_up:
intercom/src/interfaces.rs 0% <0%> (ø) :arrow_up:
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7df3cb8...d577082. Read the comment docs.

codecov-io commented 5 years ago

Codecov Report

Merging #77 into master will decrease coverage by 0.08%. The diff coverage is 86.19%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #77      +/-   ##
==========================================
- Coverage   73.95%   73.86%   -0.09%     
==========================================
  Files          50       56       +6     
  Lines        3548     3781     +233     
==========================================
+ Hits         2624     2793     +169     
- Misses        924      988      +64
Impacted Files Coverage Δ
intercom-common/src/generators/manifest.rs 69.49% <ø> (ø) :arrow_up:
intercom-common/tests/parse_tests.rs 93.54% <ø> (ø) :arrow_up:
intercom/src/lib.rs 25% <ø> (ø) :arrow_up:
intercom-cli/src/main.rs 0% <0%> (ø) :arrow_up:
intercom-common/src/idents.rs 62.96% <0%> (-7.88%) :arrow_down:
intercom/src/interfaces.rs 0% <0%> (ø) :arrow_up:
intercom-build/src/os/mod.rs 0% <0%> (ø) :arrow_up:
intercom-common/src/attributes/com_library.rs 0% <0%> (ø) :arrow_up:
intercom-common/src/model/mod.rs 0% <0%> (ø)
intercom-build/src/lib.rs 0% <0%> (ø) :arrow_up:
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7df3cb8...ba193ac. Read the comment docs.

codecov-io commented 5 years ago

Codecov Report

Merging #77 into master will decrease coverage by 0.12%. The diff coverage is 86.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #77      +/-   ##
==========================================
- Coverage   73.95%   73.83%   -0.13%     
==========================================
  Files          50       56       +6     
  Lines        3548     3780     +232     
==========================================
+ Hits         2624     2791     +167     
- Misses        924      989      +65
Impacted Files Coverage Δ
intercom-common/src/guid.rs 91.47% <ø> (ø) :arrow_up:
intercom-common/src/generators/manifest.rs 69.49% <ø> (ø) :arrow_up:
intercom-common/tests/parse_tests.rs 93.54% <ø> (ø) :arrow_up:
intercom/src/guid.rs 90.75% <ø> (ø) :arrow_up:
intercom/src/lib.rs 25% <ø> (ø) :arrow_up:
intercom/src/comrc.rs 0% <ø> (ø) :arrow_up:
intercom/src/strings.rs 67.19% <ø> (ø) :arrow_up:
intercom-cli/src/main.rs 0% <0%> (ø) :arrow_up:
intercom-common/src/idents.rs 62.96% <0%> (-7.88%) :arrow_down:
intercom/src/interfaces.rs 0% <0%> (ø) :arrow_up:
... and 38 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7df3cb8...9c6d954. Read the comment docs.

Rantanen commented 5 years ago

Took care of most of the technical comments.

The refactoring comments were left unattended for now. There is a plan of some sort to refactor the code generation in general so those should be taken care of then. Not perfectly happy with the way the type systems work currently.

Also we're up to date with Rust 1.29 I believe. We might start looking into getting rid of the remaining unstable feature flags.