diff options
| author | Li Jin <dragon-fly@qq.com> | 2020-03-21 12:42:44 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2020-03-21 12:42:44 +0800 |
| commit | c4556457629bebbb632dbf4e87a49e2d684697c2 (patch) | |
| tree | 558e02634ac622f20643b570058a74966ff97e6a | |
| parent | 3bb3036f12247bd87afdf81dfef7e695c8fe3528 (diff) | |
| download | yuescript-c4556457629bebbb632dbf4e87a49e2d684697c2.tar.gz yuescript-c4556457629bebbb632dbf4e87a49e2d684697c2.tar.bz2 yuescript-c4556457629bebbb632dbf4e87a49e2d684697c2.zip | |
update readme.
| -rw-r--r-- | README.md | 9 |
1 files changed, 7 insertions, 2 deletions
| @@ -60,8 +60,7 @@ $config! | |||
| 60 | -- file 'main.moon' | 60 | -- file 'main.moon' |
| 61 | import 'macro' as {:$config, :$assert, :$asserts} | 61 | import 'macro' as {:$config, :$assert, :$asserts} |
| 62 | 62 | ||
| 63 | macro expr and = (...)-> | 63 | macro expr and = (...)-> "#{ table.concat {...}, ' and ' }" |
| 64 | "#{ table.concat {...}, ' and ' }" | ||
| 65 | 64 | ||
| 66 | $asserts item ~= nil | 65 | $asserts item ~= nil |
| 67 | $config false | 66 | $config false |
| @@ -96,6 +95,7 @@ export map = (items, func)-> [func item for item in *items] | |||
| 96 | export filter = (items, func)-> [item for item in *items when func item] | 95 | export filter = (items, func)-> [item for item in *items when func item] |
| 97 | 96 | ||
| 98 | -- file 'main.moon' | 97 | -- file 'main.moon' |
| 98 | import 'Config' as {:flag, :value} | ||
| 99 | import 'Utils' as {:map, :filter} | 99 | import 'Utils' as {:map, :filter} |
| 100 | ``` | 100 | ``` |
| 101 | Compiles to: | 101 | Compiles to: |
| @@ -139,6 +139,11 @@ _module_0["filter"] = filter | |||
| 139 | return _module_0 | 139 | return _module_0 |
| 140 | 140 | ||
| 141 | -- file 'main.moon' | 141 | -- file 'main.moon' |
| 142 | local flag, value | ||
| 143 | do | ||
| 144 | local _obj_0 = require('Config') | ||
| 145 | flag, value = _obj_0.flag, _obj_0.value | ||
| 146 | end | ||
| 142 | local map, filter | 147 | local map, filter |
| 143 | do | 148 | do |
| 144 | local _obj_0 = require('Utils') | 149 | local _obj_0 = require('Utils') |
