diff options
author | Li Jin <dragon-fly@qq.com> | 2020-03-12 11:46:29 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2020-03-12 11:46:29 +0800 |
commit | d0adaf086d91f600f497c6e267a3623f3cb9012e (patch) | |
tree | 53379de1fcb833eacdf7e183257ef5cf0cb30f77 /spec | |
parent | b2cdbc975526b710d23c41af18978afbac516240 (diff) | |
download | yuescript-d0adaf086d91f600f497c6e267a3623f3cb9012e.tar.gz yuescript-d0adaf086d91f600f497c6e267a3623f3cb9012e.tar.bz2 yuescript-d0adaf086d91f600f497c6e267a3623f3cb9012e.zip |
fix line break issue in macro, disable macro declaration outside root scope.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/inputs/macro.moon | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/inputs/macro.moon b/spec/inputs/macro.moon index 07ac7b3..9083449 100644 --- a/spec/inputs/macro.moon +++ b/spec/inputs/macro.moon | |||
@@ -77,7 +77,7 @@ macro expr curry = (...)-> | |||
77 | len = #args | 77 | len = #args |
78 | body = args[len] | 78 | body = args[len] |
79 | def = table.concat ["(#{args[i]})->" for i = 1, len - 1] | 79 | def = table.concat ["(#{args[i]})->" for i = 1, len - 1] |
80 | "#{def}\n#{body\gsub "^do\n",""}" | 80 | "#{def}\n#{body\gsub "^do%s*\n",""}" |
81 | 81 | ||
82 | f = $curry x,y,z,do | 82 | f = $curry x,y,z,do |
83 | print x,y,z | 83 | print x,y,z |