hkust-taco / mlscript

The MLscript programming language. Functional and object-oriented; structurally typed and sound; with powerful type inference. Soon to have full interop with TypeScript!
https://hkust-taco.github.io/mlscript
MIT License
174 stars 27 forks source link

Support integer literals of different radices and decimal numeric literals #199

Closed chengluyu closed 11 months ago

chengluyu commented 11 months ago

This PR adds the support for various literals.

[!NOTE]
This PR does not support numeric literals starting with decimal points, for example, .5, because it conflicts with selecting tuple indices. We can check the accumulated tokens to determine the meaning of tokens such as .1, but I don't have time to summarize various situations and add tests right now, so I will leave it for future work.

chengluyu commented 11 months ago

6182f20 failed for some reasons. Strange.

NeilKleistGao commented 11 months ago

6182f20 failed for some reasons. Strange.

Random-happened time-out problem lol.