aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/codes_from_doc_zh.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/outputs/codes_from_doc_zh.lua')
-rw-r--r--spec/outputs/codes_from_doc_zh.lua18
1 files changed, 6 insertions, 12 deletions
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua
index 1a10555..a23044d 100644
--- a/spec/outputs/codes_from_doc_zh.lua
+++ b/spec/outputs/codes_from_doc_zh.lua
@@ -467,8 +467,7 @@ local x = f()
467local y = x 467local y = x
468local z = x 468local z = x
469do 469do
470 local a 470 local a = 1
471 a = 1
472 local x, y, z 471 local x, y, z
473 print("预先声明后续所有变量为局部变量") 472 print("预先声明后续所有变量为局部变量")
474 x = function() 473 x = function()
@@ -478,8 +477,7 @@ do
478 instance = Item:new() 477 instance = Item:new()
479end 478end
480do 479do
481 local X 480 local X = 1
482 X = 1
483 local B 481 local B
484 print("只预先声明后续大写的变量为局部变量") 482 print("只预先声明后续大写的变量为局部变量")
485 local a = 1 483 local a = 1
@@ -499,8 +497,7 @@ do
499 print("只预先声明大写的变量为全局变量") 497 print("只预先声明大写的变量为全局变量")
500 local a = 1 498 local a = 1
501 local B = 2 499 local B = 2
502 local Temp 500 local Temp = "一个局部值"
503 Temp = "一个局部值"
504end 501end
505local thing = { 502local thing = {
506 1, 503 1,
@@ -2472,8 +2469,7 @@ local x = f()
2472local y = x 2469local y = x
2473local z = x 2470local z = x
2474do 2471do
2475 local a 2472 local a = 1
2476 a = 1
2477 local x, y, z 2473 local x, y, z
2478 print("预先声明后续所有变量为局部变量") 2474 print("预先声明后续所有变量为局部变量")
2479 x = function() 2475 x = function()
@@ -2483,8 +2479,7 @@ do
2483 instance = Item:new() 2479 instance = Item:new()
2484end 2480end
2485do 2481do
2486 local X 2482 local X = 1
2487 X = 1
2488 local B 2483 local B
2489 print("只预先声明后续大写的变量为局部变量") 2484 print("只预先声明后续大写的变量为局部变量")
2490 local a = 1 2485 local a = 1
@@ -2504,8 +2499,7 @@ do
2504 print("只预先声明大写的变量为全局变量") 2499 print("只预先声明大写的变量为全局变量")
2505 local a = 1 2500 local a = 1
2506 local B = 2 2501 local B = 2
2507 local Temp 2502 local Temp = "一个局部值"
2508 Temp = "一个局部值"
2509end 2503end
2510local thing = { 2504local thing = {
2511 1, 2505 1,