We currently (main) have implemented the following literals:
String (basic form)
Boolean
Unit
For 0.0.4 I want us to also implement number literals (both integer and double literals).
There are still many things to decide about number literals, specially regarding different bases (you can see and contribute to the discussion here). I'm not sure how or when we will solve them, so for this version we will have a limited version of numbers literals, with just support for decimal base (nothing indicating the base), both integer and double, with support for separators.
We currently (main) have implemented the following literals:
For 0.0.4 I want us to also implement number literals (both integer and double literals).
There are still many things to decide about number literals, specially regarding different bases (you can see and contribute to the discussion here). I'm not sure how or when we will solve them, so for this version we will have a limited version of numbers literals, with just support for decimal base (nothing indicating the base), both integer and double, with support for separators.
The grammar is as follows:
Some examples:
Notice that, different from Dart,
.0
is not a valid double. The prefix has always to include a0
for double, so0.5
.The implementation should compile to the equivalent Dart number literal, which is mostly the same.