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

Reimplement wac-parser on wac-graph. #82

Merged
merged 15 commits into from
Apr 15, 2024

Commits on Apr 14, 2024

  1. Reimplement wac-parser on wac-graph.

    This commit is a complete reimplementation of `wac-parser`'s resolution to be
    based on `wac-graph`.
    
    It also contains an overhaul of the `wac-graph` API to facilitate its use from
    `wac-parser`:
    
    * Reimplements `CompositionGraph` on top of `petgraph::StableDiGraph`, which
      eliminates needing to keep track of nodes internally to `CompositionGraph`.
    * Packages now populate their type information into the graph's types
      collection rather than having their own collections.
    * Splits the `Error` enum into discrete error types for each graph operation;
      this allows the AST resolver to properly attach span information to errors.
    * Add type dependency edges for defined types, ensuring topological ordering.
    * Fix encoding of defined type aliases so that each encoded alias refers to the
      export index of the previously encoded type.
    * Added a debug formatter for `CompositionGraph` that outputs a DOT
      representation (used in resolution tests as well).
    * Graph encoding now includes an optional producers custom section.
    * Fixed toposort to be in ascending node index order for independent nodes.
    
    The subtype checker implementation was reverted to the previous implementation,
    where `invert` and `revert` are called at specific points to change the type of
    check being performed; the newer implementation did not give the correct
    "expected, found" error messages for AST resolution.
    
    `wac resolve` now outputs a DOT representation of the resolved composition
    graph instead of JSON.
    
    Most of the deleted code comes from code that has already moved into
    `wac-types` and `wac-graph`.
    
    Closes #79.
    Fixes #78.
    Fixes #76.
    peterhuene committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    ff6cf2b View commit details
    Browse the repository at this point in the history
  2. Add names section to encoded WAC documents.

    Implements #37.
    peterhuene committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    0970c6d View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2024

  1. Update crates/wac-graph/src/graph.rs

    Co-authored-by: Ryan Levick <[email protected]>
    peterhuene and rylev authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    e9092b9 View commit details
    Browse the repository at this point in the history
  2. Update crates/wac-graph/src/graph.rs

    Co-authored-by: Ryan Levick <[email protected]>
    peterhuene and rylev authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    fd34bfa View commit details
    Browse the repository at this point in the history
  3. Update crates/wac-graph/src/graph.rs

    Co-authored-by: Ryan Levick <[email protected]>
    peterhuene and rylev authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    a6bed3a View commit details
    Browse the repository at this point in the history
  4. Update crates/wac-graph/src/graph.rs

    Co-authored-by: Ryan Levick <[email protected]>
    peterhuene and rylev authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    18a314d View commit details
    Browse the repository at this point in the history
  5. Update crates/wac-graph/src/graph.rs

    Co-authored-by: Ryan Levick <[email protected]>
    peterhuene and rylev authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    182414c View commit details
    Browse the repository at this point in the history
  6. Update crates/wac-graph/src/graph.rs

    Co-authored-by: Ryan Levick <[email protected]>
    peterhuene and rylev authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    4998392 View commit details
    Browse the repository at this point in the history
  7. Update crates/wac-graph/src/graph.rs

    Co-authored-by: Ryan Levick <[email protected]>
    peterhuene and rylev authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    392a45a View commit details
    Browse the repository at this point in the history
  8. Update crates/wac-graph/src/graph.rs

    Co-authored-by: Ryan Levick <[email protected]>
    peterhuene and rylev authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    f626337 View commit details
    Browse the repository at this point in the history
  9. Update test baselines.

    peterhuene committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    e77ae99 View commit details
    Browse the repository at this point in the history
  10. Fix infinite recursion caused by aliased resources.

    This commit fixes an existing bug exposed by the refactoring (likely due to the
    changes in the order in which nodes are processed for implicit arguments).
    
    Previously, an interface might contain a type alias for another resource it
    owns; this lead to the alias information of the resource being self-referential
    for the interface containing the aliased resource.
    
    It would then lead to infinite recursion in an attempt to remap such an
    interface when populating implicit instantiation arguments.
    
    The fix is to clear the self-referencing information while converting an
    interface during package parsing.
    peterhuene committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    6d44da5 View commit details
    Browse the repository at this point in the history
  11. Code review feedback.

    peterhuene committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    a94f2ae View commit details
    Browse the repository at this point in the history
  12. Update crates/wac-types/src/component.rs

    Co-authored-by: Ryan Levick <[email protected]>
    peterhuene and rylev authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    b7d5e89 View commit details
    Browse the repository at this point in the history
  13. Fix formatting.

    peterhuene committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    a38e629 View commit details
    Browse the repository at this point in the history