aboutsummaryrefslogtreecommitdiff
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-02-20 17:34:52 +0800
committerLi Jin <dragon-fly@qq.com>2021-02-20 17:34:52 +0800
commitc44cab60b7b6cf0a36e1dd011c2fe483e8d87b38 (patch)
tree9fcf8a06e63991a27b8f73b4e5040788338d115f /CHANGELOG.md
parent3ea3f9b1c42eae103c370a986f539a0f1550db9f (diff)
downloadyuescript-c44cab60b7b6cf0a36e1dd011c2fe483e8d87b38.tar.gz
yuescript-c44cab60b7b6cf0a36e1dd011c2fe483e8d87b38.tar.bz2
yuescript-c44cab60b7b6cf0a36e1dd011c2fe483e8d87b38.zip
fix issue in destructure syntax.
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md91
1 files changed, 78 insertions, 13 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e1be05..347f6e2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,33 +3,98 @@
3The implementation for 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. 3The implementation for 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 5
6## v0.6.6 6## v0.6.7
7 7
8### Fixed Issues 8### Fixed Issues
9 9
10* Simplify macro syntax. Macro function can either return a code string or a config table. 10* Simplify macro syntax. Macro function can either return a Yuescript string or a config table containing Lua codes.
11 11
12```moonscript 12```moonscript
13macro local = (var)-> "global *" 13macro localFunc = (var)-> "local #{var} = ->"
14$localFunc f1
15f1 = -> "another function"
14 16
15$local x 17-- or
16x = 1
17y = 2
18z = 3
19 18
20macro local = (var)-> 19macro localFunc = (var)->
21 { 20 {
22 codes: "local #{var}" 21 codes: "local function #{var}() end"
23 type: "lua" 22 type: "lua"
24 locals: {var} 23 locals: {var}
25 } 24 }
26 25$localFunc f2
27$local y 26f2 = -> "another function"
28y = 1 27```
28Compiles to:
29```Lua
30local f1
31f1 = function() end
32f1 = function()
33 return "another function"
34end
35local function f2() end
36f2 = function()
37 return "another function"
38end
29``` 39```
30 40
31* Change Yuescript file extension to '.yue' because some of the Moonscript syntax are no longer supported and some codes written in Yuescript syntax won't be accepted by Moonscript compiler. 41* Change Yuescript file extension to '.yue' because some of the Moonscript syntax are no longer supported and some codes written in Yuescript syntax won't be accepted by Moonscript compiler.
32* 42* Disable the use of local and global statement with wildcard operators.
43* Change backcall operator syntax, extra parentheses for multiline chains are no longer needed.
44```moonscript
45readFile "example.txt"
46 |> extract language, {}
47 |> parse language
48 |> emit
49 |> render
50 |> print
51```
52Compiles to:
53```Lua
54return print(render(emit(parse(extract(readFile("example.txt"), language, { }), language))))
55```
56
57
58### Added Features
59
60* Supporting multiline chaining function call syntax.
61```Moonscript
62result = origin
63 .transform.root
64 .gameObject
65 \Parents!
66 \Descendants!
67 \SelectEnable!
68 \SelectVisible!
69 \TagEqual "fx"
70 \Where (x)->
71 if x\IsTargeted!
72 return false
73 x.name\EndsWith "(Clone)"
74 \Destroy!
75
76origin.transform.root.gameObject
77 \Parents!\Descendants!
78 \SelectEnable!
79 \SelectVisible!
80 \TagEqual "fx"
81 \Where (x)-> x.name\EndsWith "(Clone)"
82 \Destroy!
83```
84Compiles to:
85```Lua
86local result = origin.transform.root.gameObject:Parents():Descendants():SelectEnable():SelectVisible():TagEqual("fx"):Where(function(x)
87 if x:IsTargeted() then
88 return false
89 end
90 return x.name:EndsWith("(Clone)")
91end):Destroy()
92return origin.transform.root.gameObject:Parents():Descendants():SelectEnable():SelectVisible():TagEqual("fx"):Where(function(x)
93 return x.name:EndsWith("(Clone)")
94end):Destroy()
95```
96
97
33 98
34## v0.4.16 99## v0.4.16
35 100