Project

General

Profile

Actions

Bug #20991

closed

Prism parses `"\C-\α"` into `"α"` which should be syntax error

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

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.5.0dev (2024-12-27T07:27:30Z master adbbc9109e) +YJIT +MN +PRISM [arm64-darwin22]
[ruby-core:120437]

Description

$ ./ruby -e 'p "\C-\α"'
"α"

I think it should raise Invalid escape character syntax just like "\C-α" does.

"\C-α"
# Invalid escape character syntax

"\C-"
# Prism: "α"
# parse.y:  invalid multibyte char (UTF-8), reported in #20990
Actions

Also available in: Atom PDF

Like0
Like0