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

Unescaping cleanups #118734

Merged
merged 9 commits into from
Dec 9, 2023
Merged

Unescaping cleanups #118734

merged 9 commits into from
Dec 9, 2023

Commits on Dec 6, 2023

  1. De-pub some functions.

    nnethercote committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    856b55f View commit details
    Browse the repository at this point in the history
  2. Identify impossible cases in ascii_escapes_should_be_ascii.

    Raw strings (of all kinds) don't support escapes, so this function
    should never be called on them.
    nnethercote committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    e290582 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c6bbb37 View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2023

  1. Configuration menu
    Copy the full SHA
    08b8ba0 View commit details
    Browse the repository at this point in the history
  2. Remove explicit \n and \t handling in unescape_str_common.

    The fallback `_` case works for these chars, no need to treat them
    specially.
    nnethercote committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    f883762 View commit details
    Browse the repository at this point in the history
  3. Eliminate is_byte: bool args in unescaping code.

    These don't really make sense since C string literals were added. This
    commit removes them in favour for `mode: Mode` args. `ascii_check` still
    has a `characters_should_be_ascii: bool` arg.
    
    Also, `characters_should_be_ascii` is renamed to be shorter.
    nnethercote committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    119b1d0 View commit details
    Browse the repository at this point in the history
  4. Tweak the no-nuls.rs test.

    The `empty!` macro calls should be outside the `cfg(FALSE)` function.
    nnethercote committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    9741dba View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    adc46e5 View commit details
    Browse the repository at this point in the history
  6. Tweak Mode.

    - Add `use Mode::*` to avoid all the qualifiers.
    - Reorder the variants. The existing order makes no particular sense,
      which has bugged me for some time. I've chosen an order that makes
      sense to me.
    nnethercote committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    0a401b6 View commit details
    Browse the repository at this point in the history