[ruby-core:113977] [Ruby master Bug#19743] Ruby's parser seems to ignoring DOT at the end of file just after digits
From:
"tompng (tomoya ishida) via ruby-core" <ruby-core@...>
Date:
2023-06-21 19:12:37 UTC
List:
ruby-core #113977
Issue #19743 has been reported by tompng (tomoya ishida).
----------------------------------------
Bug #19743: Ruby's parser seems to ignoring DOT at the end of file just after digits
https://bugs.ruby-lang.org/issues/19743
* Author: tompng (tomoya ishida)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0dev (2023-06-19T09:28:10Z master 2a80bac9f0) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
I expect all to be syntax error
~~~ruby
eval "puts 1." #=> 1
eval "puts 1. " #=> syntax error
eval "puts 1.\n" #=> syntax error
~~~
For ripper, period token is missing
~~~ruby
Ripper.tokenize("1.") #=> ["1"]
Ripper.tokenize("1. ") #=> ["1", ".", " "]
~~~
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/