Skip to content

Expand support for integer literals #56

@AStenbaek

Description

@AStenbaek

I suggest we update the frontend of Troupe to support commonly supported notation for integer literals. This notation is widely supported in a vast number of programming languages (Python, OCaml, Scala, Rust, etc.).

For concreteness this involves the following tasks:

  • Add support for numeric literal prefixes 0b (base-2), 0o (base-8), and 0x (base-16). For example we then could write 28 as 0b11100, 0o34, or 0x1c.
  • Add support for using _ as a separator for integer literals, so 1000000 can also be written 1_000_000.

Metadata

Metadata

Assignees

Labels

✨ enhancementNew feature or request📁 ./compilerChanges, errors, and additions for the compiler

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions