diff options
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r-- | CHANGELOG.md | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b60bf8a..1c87ff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | The implementation for the original Moonscript language 0.5.0 can be found in the `0.5.0` branch of Yuescript. The Moonscript with fixes and new features is in the main branch of Yuescript. Here are the changelogs for each Yuescript version. | 3 | The implementation for the original Moonscript language 0.5.0 can be found in the `0.5.0` branch of Yuescript. The Moonscript with fixes and new features is in the main branch of Yuescript. Here are the changelogs for each Yuescript version. |
4 | 4 | ||
5 | ## v0.8.2 | 5 | ## v0.8.5 |
6 | 6 | ||
7 | ### Fixed Issues | 7 | ### Fixed Issues |
8 | 8 | ||
@@ -11,6 +11,38 @@ The implementation for the original Moonscript language 0.5.0 can be found in th | |||
11 | 11 | ||
12 | ### Added Features | 12 | ### Added Features |
13 | 13 | ||
14 | * Nil coalescing operator. | ||
15 | ```moonscript | ||
16 | local a, b, c, d | ||
17 | a = b ?? c ?? d | ||
18 | func a ?? {} | ||
19 | |||
20 | a ??= false | ||
21 | ``` | ||
22 | Compiles to: | ||
23 | ```lua | ||
24 | local a, b, c, d | ||
25 | if b ~= nil then | ||
26 | a = b | ||
27 | else | ||
28 | if c ~= nil then | ||
29 | a = c | ||
30 | else | ||
31 | a = d | ||
32 | end | ||
33 | end | ||
34 | func((function() | ||
35 | if a ~= nil then | ||
36 | return a | ||
37 | else | ||
38 | return { } | ||
39 | end | ||
40 | end)()) | ||
41 | if a == nil then | ||
42 | a = false | ||
43 | end | ||
44 | ``` | ||
45 | |||
14 | * New metatable syntax. | 46 | * New metatable syntax. |
15 | ```moonscript | 47 | ```moonscript |
16 | #: mt = tb | 48 | #: mt = tb |