mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[Bug #20988] [prism] Fix escaped octal character literals
This commit is contained in:
parent
689bb193cc
commit
a33c944ba8
Notes:
git
2024-12-29 02:09:36 +00:00
2 changed files with 3 additions and 0 deletions
|
@ -9728,6 +9728,7 @@ escape_read(pm_parser_t *parser, pm_buffer_t *buffer, pm_buffer_t *regular_expre
|
|||
}
|
||||
}
|
||||
|
||||
value = escape_byte(value, flags);
|
||||
escape_write_byte(parser, buffer, regular_expression_buffer, flags, value);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -101,6 +101,8 @@ class TestRubyLiteral < Test::Unit::TestCase
|
|||
assert_raise(SyntaxError) {eval('"\C-\\' "\u3042" '"')}
|
||||
assert_raise(SyntaxError) {eval('"\M-' "\u3042" '"')}
|
||||
assert_raise(SyntaxError) {eval('"\M-\\' "\u3042" '"')}
|
||||
|
||||
assert_equal "\x09 \xC9 \x89", eval('"\C-\111 \M-\111 \M-\C-\111"')
|
||||
ensure
|
||||
$VERBOSE = verbose_bak
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue