Project

General

Profile

Actions

Bug #19743

closed

Ruby's parser seems to ignoring DOT at the end of file just after digits

Added by tompng (tomoya ishida) 11 months ago. Updated 10 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-06-19T09:28:10Z master 2a80bac9f0) [x86_64-linux]
[ruby-core:113977]

Description

I expect all to be syntax error

eval "puts 1." #=> 1
eval "puts 1. " #=> syntax error
eval "puts 1.\n" #=> syntax error

For ripper, period token is missing

Ripper.tokenize("1.") #=> ["1"]
Ripper.tokenize("1. ") #=> ["1", ".", " "]

Updated by nobu (Nobuyoshi Nakada) 11 months ago

  • Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED

Seems since 2.5.
I tried bisecting 2.5 branch, but configure generated with recent autoconf doesn't work.

Actions #2

Updated by nobu (Nobuyoshi Nakada) 11 months ago

  • Status changed from Open to Closed

Applied in changeset git|1344de56219cf83ca146c5346783f8483af534f9.


[Bug #19743] All but EOF can be read again after push-back

Updated by nagachika (Tomoyuki Chikanaga) 10 months ago

  • Backport changed from 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED to 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONTNEED

Since it's obviously a bug, it had been long-standing and fixing it could break executing existing script.
I don't backport it to ruby_3_2 for now. Any opinion?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0