Actions
Bug #19924
closedCharacter literal escaped \xFF stops parsing
Description
When you have a character literal, you can have an escaped character. For things that don't actually need escaping, this works out to just returning the character itself. For example:
?\d # => "d"
This works for every codepoint in ASCII-8bit except 0xFF. When that byte is hit, the entire parser will stop parsing and just return nil
.
eval(<<~RUBY)
# encoding: ascii-8bit
p ?\\\xFF
puts "this will never be parsed"
RUBY
If you try to parse it with RubyVM::AbstractSyntaxTree
, it's clear the parser just stops:
RubyVM::AbstractSyntaxTree.parse(<<~RUBY)
# encoding: ascii-8bit
p ?\\\xFF
puts "this will never be parsed"
RUBY
# => (SCOPE@1:0-2:1 tbl: [] args: nil body: (VCALL@2:0-2:1 :p))
Actions
Like0
Like0Like0Like0