Project

General

Profile

Actions

Bug #20517

closed

`Ripper.tokenize('"\\M-あ"')` separates encoding valid string to encoding invalid string.

Added by tompng (tomoya ishida) about 1 month ago. Updated 29 days ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.0dev (2024-04-11T08:57:52Z master e7f8db9079) [x86_64-linux]
[ruby-core:118132]

Description

Ripper.tokenize '"\\M-あ"'
=> ["\"", "\\M-\xE3", "\x81", "\x82", "\""]

I expect all tokens to be valid_encoding if the source string is valid_encoding.
Similar to https://bugs.ruby-lang.org/issues/20030

Actions #1

Updated by nobu (Nobuyoshi Nakada) about 1 month ago

  • Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED
Actions #3

Updated by nobu (Nobuyoshi Nakada) about 1 month ago

  • Status changed from Open to Closed

Applied in changeset git|05553cf22d43dd78b8f30cc4591230b5c000c538.


[Bug #20517] Make a multibyte character one token at meta escape

Updated by k0kubun (Takashi Kokubun) 29 days ago

  • Backport changed from 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: REQUIRED, 3.3: DONE
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0