whitequark / parser

A Ruby parser.
Other
1.57k stars 197 forks source link

ruby/ruby@17b0643 #949

Closed iliabylich closed 8 months ago

iliabylich commented 10 months ago

https://github.com/ruby/ruby/commit/17b0643392749f45b7aacb64fc1c1bd704d42b4c

iliabylich commented 8 months ago

There's nothing to backport.

The following code:

# encoding: ascii-8bit
p ?\� # <- this is \xFF byte

Is parsed by Ruby 3.2 as:

$ ruby -v --dump=parsetree test.rb
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23]
###########################################################
## Do NOT use this node dump for any purpose other than  ##
## debug and research.  Compatibility is not guaranteed. ##
###########################################################

# @ NODE_SCOPE (id: 1, line: 1, location: (1,0)-(2,1))
# +- nd_tbl: (empty)
# +- nd_args:
# |   (null node)
# +- nd_body:
#     @ NODE_VCALL (id: 0, line: 2, location: (2,0)-(2,1))*
#     +- nd_mid: :p

e.g. just as p with no arguments. Ruby 3.3 prints "\xFF" and so does the parser. Closing, we don't backport bugs.