aboutsummaryrefslogtreecommitdiff
path: root/doc/docs/doc/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/docs/doc/README.md')
-rwxr-xr-xdoc/docs/doc/README.md12
1 files changed, 4 insertions, 8 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md
index 4eec2d5..89bd643 100755
--- a/doc/docs/doc/README.md
+++ b/doc/docs/doc/README.md
@@ -282,16 +282,14 @@ A macro function can either return a YueScript string or a config table containi
282```moonscript 282```moonscript
283macro yueFunc = (var) -> "local #{var} = ->" 283macro yueFunc = (var) -> "local #{var} = ->"
284$yueFunc funcA 284$yueFunc funcA
285funcA = -> "fail to assign to the Yue defined variable" 285funcA = -> "fail to assign to the Yue macro defined variable"
286 286
287-- YueScript knows the
288-- local variables you declared in Lua code
289macro luaFunc = (var) -> { 287macro luaFunc = (var) -> {
290 code: "local function #{var}() end" 288 code: "local function #{var}() end"
291 type: "lua" 289 type: "lua"
292} 290}
293$luaFunc funcB 291$luaFunc funcB
294funcB = -> "assign to the Lua defined variable" 292funcB = -> "fail to assign to the Lua macro defined variable"
295 293
296macro lua = (code) -> { 294macro lua = (code) -> {
297 :code 295 :code
@@ -310,16 +308,14 @@ end
310<pre> 308<pre>
311macro yueFunc = (var) -> "local #{var} = ->" 309macro yueFunc = (var) -> "local #{var} = ->"
312$yueFunc funcA 310$yueFunc funcA
313funcA = -> "fail to assign to the Yue defined variable" 311funcA = -> "fail to assign to the Yue macro defined variable"
314 312
315-- YueScript knows the
316-- local variables you declared in Lua codes
317macro luaFunc = (var) -> { 313macro luaFunc = (var) -> {
318 code: "local function #{var}() end" 314 code: "local function #{var}() end"
319 type: "lua" 315 type: "lua"
320} 316}
321$luaFunc funcB 317$luaFunc funcB
322funcB = -> "assign to the Lua defined variable" 318funcB = -> "fail to assign to the Lua macro defined variable"
323 319
324macro lua = (code) -> { 320macro lua = (code) -> {
325 :code 321 :code