Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

[BUG] Underscores as digit separators are not supported in the grammar #72

Description

@mmanela

Describe the bug

Hack documentation says you can use underscores as digit separators but the grammar errors if you use them.

Requirements

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

To Reproduce

Use an integer with underscore digit separators

 $a = 123_456;

Which currently parses as the following (notice the ERROR)

(expression_statement
        (binary_expression
          left: (variable)
          (ERROR
            (integer))
          right: (qualified_identifier
            (identifier))))

Expected behavior

I expect usage of the underscore digit separator to parse properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions