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

Support passing values into dbg with the pipe operator #7058

Merged
merged 4 commits into from
Sep 6, 2024

Commits on Sep 6, 2024

  1. Use a shared env for desugaring and the rest of canonicalization

    This refactor simplifies the desugar pass by reducing the number of
    arguments threaded through each recursive function call.
    
    - Add the module src string to `Env`.
    - Add `line_info` to `Env` as a lazy-evaled function.
    - Refactor desugar functions to take the `can::Env` struct in place of a
      number of params. This is mostly a find-and-replace, but in a few
      places `Vec::from_iter_in` was changed to `Vec::with_capacity_in`
      followed by a `for` loop in order to avoid lifetime issues.
    - Remove unnecessary linter annotations for `clippy::too_many_arguments`
    mulias committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    b515bfa View commit details
    Browse the repository at this point in the history
  2. Support passing values into dbg with the pipe operator

    In order to desugar `dbg` in a pipeline we need to allow a bare `dbg`
    node in desugaring and only report it as an error if the bare node
    survives to the next step of canonicalization. This means we move the
    error code out of `desugar_expr` and into `canonicalize_expr`. This is
    much simpler to do now that these functions use the same `env` struct,
    since previously we would have had to pass down extra args to
    `canonicalize_expr`. Sharing the `env` struct means that we also don't
    have to worry about calculating `line_info` more than once.
    mulias committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    19931ec View commit details
    Browse the repository at this point in the history
  3. Cleanup unused function param

    mulias committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    25af18d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    85aad0d View commit details
    Browse the repository at this point in the history