Skip to content

Failure to reject invalid float forms with proper message #2126

@headius

Description

@headius

I believe this is a recent change. This case from mri/ruby/test_syntax should pass:

  def test_unexpected_fraction
    msg = /unexpected fraction/
    assert_syntax_error("0x0.0", msg)
    assert_syntax_error("0b0.0", msg)
    assert_syntax_error("0d0.0", msg)
    assert_syntax_error("0o0.0", msg)
    assert_syntax_error("0.0.0", msg)
  end

We do reject the first form, but our error message is wrong ("SyntaxError: -e:1: no . floating literal anymore; put 0 before dot"). I'm not sure about the others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions