aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-02-02 23:56:41 +0800
committerLi Jin <dragon-fly@qq.com>2020-02-02 23:56:41 +0800
commit6eb2c2a58f36196d162433b5412b15aea1e6ba9e (patch)
treee6b0797ed46ea9903ee6da93f770c0721db878d5
parentaa57156b2c711bf4781d097d4748e9bc57f937b8 (diff)
downloadyuescript-6eb2c2a58f36196d162433b5412b15aea1e6ba9e.tar.gz
yuescript-6eb2c2a58f36196d162433b5412b15aea1e6ba9e.tar.bz2
yuescript-6eb2c2a58f36196d162433b5412b15aea1e6ba9e.zip
update readme.
-rw-r--r--README.md18
1 files changed, 10 insertions, 8 deletions
diff --git a/README.md b/README.md
index 134c6aa..b4b5be3 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
1# MoonPlus 1# MoonPlus
2 2
3![CI](https://github.com/pigpigyyy/MoonPlus/workflows/build-test/badge.svg) 3![CI](https://github.com/pigpigyyy/MoonPlus/workflows/build-test/badge.svg)
4MoonPlus is a compiler with features from Moonscript language 0.5.0 and could be faster than the original Moonscript compiler. 4MoonPlus is a compiler with features from [Moonscript language](https://github.com/leafo/moonscript) 0.5.0 and could be faster than the original Moonscript compiler.
5 5
6## Features 6## Features
7 7
@@ -12,8 +12,10 @@ MoonPlus is a compiler with features from Moonscript language 0.5.0 and could be
12 12
13## Changes 13## Changes
14 14
15* Add multi-line comment support. 15The original Moonscript language 0.5.0 support can be found in the `0.5.0` branch. Moonscript with new features is in the master branch. Here are the new features introduced in MoonPlus
16* Add usage for symbol `\` to escape new line. Will compile codes: 16
17* Multi-line comment.
18* Usage for symbol `\` to escape new line. Will compile codes:
17```Moonscript 19```Moonscript
18str = --[[ 20str = --[[
19 This is a multi line comment. 21 This is a multi line comment.
@@ -30,7 +32,7 @@ local str = strA .. strB .. strC
30func("192.168.126.110", 3000) 32func("192.168.126.110", 3000)
31``` 33```
32 34
33* Add back call features support with new operator and syntax. For example: 35* Back call features with new operator and syntax. For example:
34```Moonscript 36```Moonscript
35{1,2,3} \ 37{1,2,3} \
36 |> map((x)-> x * 2) \ 38 |> map((x)-> x * 2) \
@@ -45,7 +47,7 @@ do
45 body[".result"]\append processed 47 body[".result"]\append processed
46 print "done" 48 print "done"
47``` 49```
48&emsp;&emsp;compiles to: 50&emsp;&emsp;will be compiled to:
49```Lua 51```Lua
50print(reduce(filter(map({ 52print(reduce(filter(map({
51 1, 53 1,
@@ -69,7 +71,7 @@ do
69end 71end
70``` 72```
71 73
72* Add existential operator support. Generate codes from: 74* Existential operator support. Generate codes from:
73```Moonscript 75```Moonscript
74func?! 76func?!
75 77
@@ -104,7 +106,7 @@ if print and (x ~= nil) then
104end 106end
105``` 107```
106 108
107* Add more features for `import` keyword. Will compile codes from: 109* More usages for `import` keyword. Will compile codes from:
108```Moonscript 110```Moonscript
109import 'module' 111import 'module'
110import "module.part" 112import "module.part"
@@ -136,7 +138,7 @@ local _call_4 = _call_3["then"](_call_3, "xyz")
136_call_4["else"](_call_4, res) 138_call_4["else"](_call_4, res)
137``` 139```
138 140
139* Add feature of `reusing variable` which helps generate reduced Lua codes. For example, MoonPlus will generate codes from: 141* Feature of `Reusing variable` which helps generate reduced Lua codes. For example, MoonPlus will generate codes from:
140```Moonscript 142```Moonscript
141with leaf 143with leaf
142 .world 1,2,3 144 .world 1,2,3