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 DebugText for self-documenting f-strings #6167

Merged
merged 5 commits into from
Aug 1, 2023

Commits on Jul 31, 2023

  1. add DebugText for self-documenting f-strings

    instead of modelling self-documenting f-strings (`f"{ foo= }"`) as a
    (simplified)
    `Constant("foo=")` followed by a `FormattedValue(Expr("x"))`, instead
    model this case with a `DebugText(leading, trailing)` attribute on the
    `FormattedValue` so that we don't have to synthesize nodes (which
    results in siblings with overlapping ranges). We need to be able to
    preserve the whitespace for self-documenting f-strings, as well as
    reproduce the source (eg unparse, format).
    davidszotten committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    dd748af View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    68659fe View commit details
    Browse the repository at this point in the history
  3. one more test

    davidszotten committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    61a895d View commit details
    Browse the repository at this point in the history
  4. &option<_> -> option<&_>

    davidszotten committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    f7ead78 View commit details
    Browse the repository at this point in the history
  5. avoid some allocations

    davidszotten committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    ff200c6 View commit details
    Browse the repository at this point in the history