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

[Backport 1.17] fix: Handle escape and regex characters #932

Merged
merged 4 commits into from
Sep 25, 2024

Commits on Sep 25, 2024

  1. refactor: Use parameterized test case

    (cherry picked from commit c8b01bd)
    saig0 authored and github-actions[bot] committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    d390f40 View commit details
    Browse the repository at this point in the history
  2. refactor: Combine test cases

    (cherry picked from commit 58efca9)
    saig0 authored and github-actions[bot] committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    70acc1a View commit details
    Browse the repository at this point in the history
  3. test: Verify string literal with regex characters

    (cherry picked from commit 544c038)
    saig0 authored and github-actions[bot] committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    66979c1 View commit details
    Browse the repository at this point in the history
  4. fix: Handle escape sequences

    Correct the handling of escape sequences in string literals.
    
    Don't replace escape sequences in regex expressions, for example, \r or \n. In the parser, these sequences start with \\. Same for \s, don't replace it with a whitespace, since this is also a part of a regex.
    
    Handle \\ to avoid that the sequence is escaped and returned as \\\\.
    
    (cherry picked from commit d266e80)
    saig0 authored and github-actions[bot] committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    c7d2f1e View commit details
    Browse the repository at this point in the history