Skip to content

[P2] Numeric literals: hex (0xFF), octal (0o17), binary (0b1010) #24

Description

@ecto

Today 0xff parses as 0 (the parser silently discards the
non-digit suffix). Most modern languages accept hex, octal, and
binary integer literals.

Acceptance criteria

  • Lex 0x[0-9a-fA-F_]+, 0o[0-7_]+, 0b[01_]+ as Int.
  • Reject malformed forms (0x, 0xg1, etc.) with a parse error.
  • Tests in the parser suite.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions