teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.1k stars 108 forks source link

Consider allowing underscores in number literals #546

Closed Calandiel closed 2 years ago

Calandiel commented 2 years ago

Currently, literals like 100_000 aren't allowed. It's a relatively common quality of life feature in more modern languages and makes dealing with large constants easier. It should be relatively easy to implement (ignore underscores when dealing with number literals and don't keep them in the Lua output). I could make a PR if it's something you'd be interested in adding to the language.

hishamhm commented 2 years ago

@Calandiel Thanks for the suggestion! But for now we're trying to stick only to language additions related to type checking, and avoid growing the language with general quality-of-life features. This might change in the future, but for now this is the focus.