aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/codes_from_doc_pt-br.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-02-06 11:54:32 +0800
committerLi Jin <dragon-fly@qq.com>2026-02-06 11:54:32 +0800
commit1f83d504bc344ffd3c8b4120b3865fd6c11a9e2d (patch)
tree1d5c39eadcbe086d2a592ac76c8f1d288adfbe9d /spec/outputs/codes_from_doc_pt-br.lua
parentaa3ecc7badfb39cb9167fb95c9a678257c1d9954 (diff)
downloadyuescript-1f83d504bc344ffd3c8b4120b3865fd6c11a9e2d.tar.gz
yuescript-1f83d504bc344ffd3c8b4120b3865fd6c11a9e2d.tar.bz2
yuescript-1f83d504bc344ffd3c8b4120b3865fd6c11a9e2d.zip
Updated docs.v0.32.9
Diffstat (limited to 'spec/outputs/codes_from_doc_pt-br.lua')
-rw-r--r--spec/outputs/codes_from_doc_pt-br.lua226
1 files changed, 110 insertions, 116 deletions
diff --git a/spec/outputs/codes_from_doc_pt-br.lua b/spec/outputs/codes_from_doc_pt-br.lua
index 0b3670c..0c9affb 100644
--- a/spec/outputs/codes_from_doc_pt-br.lua
+++ b/spec/outputs/codes_from_doc_pt-br.lua
@@ -93,7 +93,7 @@ funcB = function()
93 return "fail to assign to the Lua macro defined variable" 93 return "fail to assign to the Lua macro defined variable"
94end 94end
95do 95do
96-- raw Lua codes insertion 96-- inserção de códigos Lua brutos
97if cond then 97if cond then
98 print("output") 98 print("output")
99end 99end
@@ -132,7 +132,7 @@ funcB = function()
132 return "fail to assign to the Lua macro defined variable" 132 return "fail to assign to the Lua macro defined variable"
133end 133end
134do 134do
135-- raw Lua codes insertion 135-- inserção de códigos Lua brutos
136if cond then 136if cond then
137 print("output") 137 print("output")
138end 138end
@@ -2476,7 +2476,7 @@ x = x * 10
2476x = x / 10 2476x = x / 10
2477x = x % 10 2477x = x % 10
2478local s = s .. "world" 2478local s = s .. "world"
2479local arg = arg or "default value" 2479local arg = arg or "valor padrão"
2480local a = 0 2480local a = 0
2481local b = 0 2481local b = 0
2482local c = 0 2482local c = 0
@@ -2488,7 +2488,7 @@ local z = x
2488do 2488do
2489 local a = 1 2489 local a = 1
2490 local x, y, z 2490 local x, y, z
2491 print("forward declare all variables as locals") 2491 print("declarar antecipadamente todas as variáveis como locais")
2492 x = function() 2492 x = function()
2493 return 1 + y + z 2493 return 1 + y + z
2494 end 2494 end
@@ -2498,13 +2498,13 @@ end
2498do 2498do
2499 local X = 1 2499 local X = 1
2500 local B 2500 local B
2501 print("only forward declare upper case variables") 2501 print("declarar antecipadamente apenas variáveis em maiúsculas")
2502 local a = 1 2502 local a = 1
2503 B = 2 2503 B = 2
2504end 2504end
2505do 2505do
2506 a = 1 2506 a = 1
2507 print("declare all variables as globals") 2507 print("declarar todas as variáveis como globais")
2508 x = function() 2508 x = function()
2509 return 1 + y + z 2509 return 1 + y + z
2510 end 2510 end
@@ -2512,10 +2512,10 @@ do
2512end 2512end
2513do 2513do
2514 X = 1 2514 X = 1
2515 print("only declare upper case variables as globals") 2515 print("declarar apenas variáveis em masculas como globais")
2516 local a = 1 2516 local a = 1
2517 B = 2 2517 B = 2
2518 local Temp = "a local value" 2518 local Temp = "um valor local"
2519end 2519end
2520local hello = "world" 2520local hello = "world"
2521local a, b, c = 1, 2, 3 2521local a, b, c = 1, 2, 3
@@ -2527,7 +2527,7 @@ x = x * 10
2527x = x / 10 2527x = x / 10
2528x = x % 10 2528x = x % 10
2529local s = s .. "world" 2529local s = s .. "world"
2530local arg = arg or "default value" 2530local arg = arg or "valor padrão"
2531local a = 0 2531local a = 0
2532local b = 0 2532local b = 0
2533local c = 0 2533local c = 0
@@ -2539,7 +2539,7 @@ local z = x
2539do 2539do
2540 local a = 1 2540 local a = 1
2541 local x, y, z 2541 local x, y, z
2542 print("forward declare all variables as locals") 2542 print("declarar antecipadamente todas as variáveis como locais")
2543 x = function() 2543 x = function()
2544 return 1 + y + z 2544 return 1 + y + z
2545 end 2545 end
@@ -2549,13 +2549,13 @@ end
2549do 2549do
2550 local X = 1 2550 local X = 1
2551 local B 2551 local B
2552 print("only forward declare upper case variables") 2552 print("declarar antecipadamente apenas variáveis em maiúsculas")
2553 local a = 1 2553 local a = 1
2554 B = 2 2554 B = 2
2555end 2555end
2556do 2556do
2557 a = 1 2557 a = 1
2558 print("declare all variables as globals") 2558 print("declarar todas as variáveis como globais")
2559 x = function() 2559 x = function()
2560 return 1 + y + z 2560 return 1 + y + z
2561 end 2561 end
@@ -2563,10 +2563,10 @@ do
2563end 2563end
2564do 2564do
2565 X = 1 2565 X = 1
2566 print("only declare upper case variables as globals") 2566 print("declarar apenas variáveis em masculas como globais")
2567 local a = 1 2567 local a = 1
2568 B = 2 2568 B = 2
2569 local Temp = "a local value" 2569 local Temp = "um valor local"
2570end 2570end
2571local list = { 2571local list = {
2572 1, 2572 1,
@@ -2608,18 +2608,18 @@ if user then
2608end 2608end
2609local hello = os.getenv("hello") 2609local hello = os.getenv("hello")
2610if hello then 2610if hello then
2611 print("You have hello", hello) 2611 print("Vo tem hello", hello)
2612else 2612else
2613 local world = os.getenv("world") 2613 local world = os.getenv("world")
2614 if world then 2614 if world then
2615 print("you have world", world) 2615 print("vo tem world", world)
2616 else 2616 else
2617 print("nothing :(") 2617 print("nada :(")
2618 end 2618 end
2619end 2619end
2620do 2620do
2621 local success, result = pcall(function() 2621 local success, result = pcall(function()
2622 return "get result without problems" 2622 return "obter resultado sem problemas"
2623 end) 2623 end)
2624 if success then 2624 if success then
2625 print(result) 2625 print(result)
@@ -2640,18 +2640,18 @@ if user then
2640end 2640end
2641local hello = os.getenv("hello") 2641local hello = os.getenv("hello")
2642if hello then 2642if hello then
2643 print("You have hello", hello) 2643 print("Vo tem hello", hello)
2644else 2644else
2645 local world = os.getenv("world") 2645 local world = os.getenv("world")
2646 if world then 2646 if world then
2647 print("you have world", world) 2647 print("vo tem world", world)
2648 else 2648 else
2649 print("nothing :(") 2649 print("nada :(")
2650 end 2650 end
2651end 2651end
2652do 2652do
2653 local success, result = pcall(function() 2653 local success, result = pcall(function()
2654 return "get result without problems" 2654 return "obter resultado sem problemas"
2655 end) 2655 end)
2656 if success then 2656 if success then
2657 print(result) 2657 print(result)
@@ -2707,10 +2707,10 @@ local name, job
2707local _obj_0 = person 2707local _obj_0 = person
2708name, job = _obj_0.name, _obj_0.job 2708name, job = _obj_0.name, _obj_0.job
2709if name == nil then 2709if name == nil then
2710 name = "nameless" 2710 name = "sem nome"
2711end 2711end
2712if job == nil then 2712if job == nil then
2713 job = "jobless" 2713 job = "sem emprego"
2714end 2714end
2715local two, four 2715local two, four
2716local _obj_0 = items 2716local _obj_0 = items
@@ -2824,10 +2824,10 @@ local name, job
2824local _obj_0 = person 2824local _obj_0 = person
2825name, job = _obj_0.name, _obj_0.job 2825name, job = _obj_0.name, _obj_0.job
2826if name == nil then 2826if name == nil then
2827 name = "nameless" 2827 name = "sem nome"
2828end 2828end
2829if job == nil then 2829if job == nil then
2830 job = "jobless" 2830 job = "sem emprego"
2831end 2831end
2832local two, four 2832local two, four
2833local _obj_0 = items 2833local _obj_0 = items
@@ -3031,7 +3031,7 @@ local apple = setmetatable({
3031if (getmetatable(apple) ~= nil) then 3031if (getmetatable(apple) ~= nil) then
3032 p(apple.size, apple.color, getmetatable(apple).__index) 3032 p(apple.size, apple.color, getmetatable(apple).__index)
3033end 3033end
3034local _u1f31b = "月之脚本" 3034local _u1f31b = "Script da Lua"
3035_module_0["🌛"] = _u1f31b 3035_module_0["🌛"] = _u1f31b
3036return _module_0 3036return _module_0
3037local _module_0 = { } 3037local _module_0 = { }
@@ -3109,27 +3109,27 @@ local apple = setmetatable({
3109if (getmetatable(apple) ~= nil) then 3109if (getmetatable(apple) ~= nil) then
3110 p(apple.size, apple.color, getmetatable(apple).__index) 3110 p(apple.size, apple.color, getmetatable(apple).__index)
3111end 3111end
3112local _u1f31b = "月之脚本" 3112local _u1f31b = "Script da Lua"
3113_module_0["🌛"] = _u1f31b 3113_module_0["🌛"] = _u1f31b
3114return _module_0 3114return _module_0
3115local have_coins = false 3115local have_coins = false
3116if have_coins then 3116if have_coins then
3117 print("Got coins") 3117 print("Tem moedas")
3118else 3118else
3119 print("No coins") 3119 print("Sem moedas")
3120end 3120end
3121local have_coins = false 3121local have_coins = false
3122if have_coins then 3122if have_coins then
3123 print("Got coins") 3123 print("Tem moedas")
3124else 3124else
3125 print("No coins") 3125 print("Sem moedas")
3126end 3126end
3127local have_coins = false 3127local have_coins = false
3128print((function() 3128print((function()
3129 if have_coins then 3129 if have_coins then
3130 return "Got coins" 3130 return "Tem moedas"
3131 else 3131 else
3132 return "No coins" 3132 return "Sem moedas"
3133 end 3133 end
3134end)()) 3134end)())
3135local is_tall 3135local is_tall
@@ -3142,20 +3142,20 @@ is_tall = function(name)
3142end 3142end
3143local message 3143local message
3144if is_tall("Rob") then 3144if is_tall("Rob") then
3145 message = "I am very tall" 3145 message = "Sou muito alto"
3146else 3146else
3147 message = "I am not so tall" 3147 message = "o sou tão alto"
3148end 3148end
3149print(message) 3149print(message)
3150if not (os.date("%A") == "Monday") then 3150if not (os.date("%A") == "Monday") then
3151 print("it is not Monday!") 3151 print("não é segunda-feira!")
3152end 3152end
3153if not (math.random() > 0.1) then 3153if not (math.random() > 0.1) then
3154 print("You're lucky!") 3154 print("Você tem sorte!")
3155end 3155end
3156local a = 5 3156local a = 5
3157if (1 == a or 3 == a or 5 == a or 7 == a) then 3157if (1 == a or 3 == a or 5 == a or 7 == a) then
3158 print("checking equality with discrete values") 3158 print("verificando igualdade com valores discretos")
3159end 3159end
3160if (function() 3160if (function()
3161 local _check_0 = list 3161 local _check_0 = list
@@ -3166,29 +3166,26 @@ if (function()
3166 end 3166 end
3167 return false 3167 return false
3168end)() then 3168end)() then
3169 print("checking if `a` is in a list") 3169 print("verificando se `a` está na lista")
3170end
3171if not (math.random() > 0.1) then
3172 print("You're lucky!")
3173end 3170end
3174local have_coins = false 3171local have_coins = false
3175if have_coins then 3172if have_coins then
3176 print("Got coins") 3173 print("Tem moedas")
3177else 3174else
3178 print("No coins") 3175 print("Sem moedas")
3179end 3176end
3180local have_coins = false 3177local have_coins = false
3181if have_coins then 3178if have_coins then
3182 print("Got coins") 3179 print("Tem moedas")
3183else 3180else
3184 print("No coins") 3181 print("Sem moedas")
3185end 3182end
3186local have_coins = false 3183local have_coins = false
3187print((function() 3184print((function()
3188 if have_coins then 3185 if have_coins then
3189 return "Got coins" 3186 return "Tem moedas"
3190 else 3187 else
3191 return "No coins" 3188 return "Sem moedas"
3192 end 3189 end
3193end)()) 3190end)())
3194local is_tall 3191local is_tall
@@ -3201,20 +3198,20 @@ is_tall = function(name)
3201end 3198end
3202local message 3199local message
3203if is_tall("Rob") then 3200if is_tall("Rob") then
3204 message = "I am very tall" 3201 message = "Sou muito alto"
3205else 3202else
3206 message = "I am not so tall" 3203 message = "o sou tão alto"
3207end 3204end
3208print(message) 3205print(message)
3209if not (os.date("%A") == "Monday") then 3206if not (os.date("%A") == "Monday") then
3210 print("it is not Monday!") 3207 print("não é segunda-feira!")
3211end 3208end
3212if not (math.random() > 0.1) then 3209if not (math.random() > 0.1) then
3213 print("You're lucky!") 3210 print("Você tem sorte!")
3214end 3211end
3215local a = 5 3212local a = 5
3216if (1 == a or 3 == a or 5 == a or 7 == a) then 3213if (1 == a or 3 == a or 5 == a or 7 == a) then
3217 print("checking equality with discrete values") 3214 print("verificando igualdade com valores discretos")
3218end 3215end
3219if (function() 3216if (function()
3220 local _check_0 = list 3217 local _check_0 = list
@@ -3225,10 +3222,7 @@ if (function()
3225 end 3222 end
3226 return false 3223 return false
3227end)() then 3224end)() then
3228 print("checking if `a` is in a list") 3225 print("verificando se `a` está na lista")
3229end
3230if not (math.random() > 0.1) then
3231 print("You're lucky!")
3232end 3226end
3233for i = 10, 20 do 3227for i = 10, 20 do
3234 print(i) 3228 print(i)
@@ -3420,11 +3414,11 @@ end
3420odds = _accum_0 3414odds = _accum_0
3421local name = "Dan" 3415local name = "Dan"
3422if "Robert" == name then 3416if "Robert" == name then
3423 print("You are Robert") 3417 print("Vo é Robert")
3424elseif "Dan" == name or "Daniel" == name then 3418elseif "Dan" == name or "Daniel" == name then
3425 print("Your name, it's Dan") 3419 print("Seu nome é Dan")
3426else 3420else
3427 print("I don't know about you with name " .. tostring(name)) 3421 print("o sei quem vo é com o nome " .. tostring(name))
3428end 3422end
3429local b = 1 3423local b = 1
3430local next_number 3424local next_number
@@ -3433,30 +3427,30 @@ if 1 == b then
3433elseif 2 == b then 3427elseif 2 == b then
3434 next_number = 3 3428 next_number = 3
3435else 3429else
3436 next_number = error("can't count that high!") 3430 next_number = error("não consigo contar tão alto!")
3437end 3431end
3438local msg 3432local msg
3439local _exp_0 = math.random(1, 5) 3433local _exp_0 = math.random(1, 5)
3440if 1 == _exp_0 then 3434if 1 == _exp_0 then
3441 msg = "you are lucky" 3435 msg = "vo tem sorte"
3442elseif 2 == _exp_0 then 3436elseif 2 == _exp_0 then
3443 msg = "you are almost lucky" 3437 msg = "vo quase tem sorte"
3444else 3438else
3445 msg = "not so lucky" 3439 msg = "não tão sortudo"
3446end 3440end
3447do 3441do
3448 local _exp_0 = math.random(1, 5) 3442 local _exp_0 = math.random(1, 5)
3449 if 1 == _exp_0 then 3443 if 1 == _exp_0 then
3450 print("you are lucky") 3444 print("vo tem sorte")
3451 else 3445 else
3452 print("not so lucky") 3446 print("não tão sortudo")
3453 end 3447 end
3454end 3448end
3455local _exp_0 = math.random(1, 5) 3449local _exp_0 = math.random(1, 5)
3456if 1 == _exp_0 then 3450if 1 == _exp_0 then
3457 print("you are lucky") 3451 print("vo tem sorte")
3458else 3452else
3459 print("not so lucky") 3453 print("não tão sortudo")
3460end 3454end
3461local items = { 3455local items = {
3462 { 3456 {
@@ -3486,7 +3480,7 @@ for _index_0 = 1, #items do
3486 local width = item.width 3480 local width = item.width
3487 local height = item.height 3481 local height = item.height
3488 if width ~= nil and height ~= nil then 3482 if width ~= nil and height ~= nil then
3489 print("size " .. tostring(width) .. ", " .. tostring(height)) 3483 print("tamanho " .. tostring(width) .. ", " .. tostring(height))
3490 end 3484 end
3491 end 3485 end
3492 end 3486 end
@@ -3563,7 +3557,7 @@ if _tab_0 then
3563 local result = _exp_0.result 3557 local result = _exp_0.result
3564 if true == _exp_0.success and result ~= nil then 3558 if true == _exp_0.success and result ~= nil then
3565 _match_0 = true 3559 _match_0 = true
3566 print("success", result) 3560 print("sucesso", result)
3567 end 3561 end
3568end 3562end
3569if not _match_0 then 3563if not _match_0 then
@@ -3571,11 +3565,11 @@ if not _match_0 then
3571 if _tab_0 then 3565 if _tab_0 then
3572 if false == _exp_0.success then 3566 if false == _exp_0.success then
3573 _match_1 = true 3567 _match_1 = true
3574 print("failed", result) 3568 print("falhou", result)
3575 end 3569 end
3576 end 3570 end
3577 if not _match_1 then 3571 if not _match_1 then
3578 print("invalid") 3572 print("inválido")
3579 end 3573 end
3580end 3574end
3581local _exp_0 = tb 3575local _exp_0 = tb
@@ -3600,7 +3594,7 @@ if _tab_0 then
3600 end 3594 end
3601 if "success" == _val_0 and content ~= nil then 3595 if "success" == _val_0 and content ~= nil then
3602 _match_0 = true 3596 _match_0 = true
3603 print("success", content) 3597 print("sucesso", content)
3604 end 3598 end
3605end 3599end
3606if not _match_0 then 3600if not _match_0 then
@@ -3623,11 +3617,11 @@ if not _match_0 then
3623 end 3617 end
3624 if "error" == _val_0 and content ~= nil then 3618 if "error" == _val_0 and content ~= nil then
3625 _match_1 = true 3619 _match_1 = true
3626 print("failed", content) 3620 print("erro", content)
3627 end 3621 end
3628 end 3622 end
3629 if not _match_1 then 3623 if not _match_1 then
3630 print("invalid") 3624 print("inválido")
3631 end 3625 end
3632end 3626end
3633local _exp_0 = tb 3627local _exp_0 = tb
@@ -3678,7 +3672,7 @@ if _tab_0 then
3678 end 3672 end
3679 end 3673 end
3680 if 1 == _val_0 and 2 == _val_1 and 3 == _val_2 and 4 == _val_3 and 5 == _val_4 and 6 == _val_5 and fourth ~= nil then 3674 if 1 == _val_0 and 2 == _val_1 and 3 == _val_2 and 4 == _val_3 and 5 == _val_4 and 6 == _val_5 and fourth ~= nil then
3681 print("matched", fourth) 3675 print("correspondido", fourth)
3682 end 3676 end
3683end 3677end
3684local segments = { 3678local segments = {
@@ -3705,18 +3699,18 @@ if _tab_0 then
3705 local resource = segments[#segments - 1] 3699 local resource = segments[#segments - 1]
3706 local action = segments[#segments] 3700 local action = segments[#segments]
3707 if resource ~= nil and action ~= nil then 3701 if resource ~= nil and action ~= nil then
3708 print("Group:", groups) 3702 print("Grupo:", groups)
3709 print("Resource:", resource) 3703 print("Recurso:", resource)
3710 print("Action:", action) 3704 print("Ação:", action)
3711 end 3705 end
3712end 3706end
3713local name = "Dan" 3707local name = "Dan"
3714if "Robert" == name then 3708if "Robert" == name then
3715 print("You are Robert") 3709 print("Vo é Robert")
3716elseif "Dan" == name or "Daniel" == name then 3710elseif "Dan" == name or "Daniel" == name then
3717 print("Your name, it's Dan") 3711 print("Seu nome é Dan")
3718else 3712else
3719 print("I don't know about you with name " .. tostring(name)) 3713 print("o sei quem vo é com o nome " .. tostring(name))
3720end 3714end
3721local b = 1 3715local b = 1
3722local next_number 3716local next_number
@@ -3725,30 +3719,30 @@ if 1 == b then
3725elseif 2 == b then 3719elseif 2 == b then
3726 next_number = 3 3720 next_number = 3
3727else 3721else
3728 next_number = error("can't count that high!") 3722 next_number = error("não consigo contar tão alto!")
3729end 3723end
3730local msg 3724local msg
3731local _exp_0 = math.random(1, 5) 3725local _exp_0 = math.random(1, 5)
3732if 1 == _exp_0 then 3726if 1 == _exp_0 then
3733 msg = "you are lucky" 3727 msg = "vo tem sorte"
3734elseif 2 == _exp_0 then 3728elseif 2 == _exp_0 then
3735 msg = "you are almost lucky" 3729 msg = "vo quase tem sorte"
3736else 3730else
3737 msg = "not so lucky" 3731 msg = "não tão sortudo"
3738end 3732end
3739do 3733do
3740 local _exp_0 = math.random(1, 5) 3734 local _exp_0 = math.random(1, 5)
3741 if 1 == _exp_0 then 3735 if 1 == _exp_0 then
3742 print("you are lucky") 3736 print("vo tem sorte")
3743 else 3737 else
3744 print("not so lucky") 3738 print("não tão sortudo")
3745 end 3739 end
3746end 3740end
3747local _exp_0 = math.random(1, 5) 3741local _exp_0 = math.random(1, 5)
3748if 1 == _exp_0 then 3742if 1 == _exp_0 then
3749 print("you are lucky") 3743 print("vo tem sorte")
3750else 3744else
3751 print("not so lucky") 3745 print("não tão sortudo")
3752end 3746end
3753local items = { 3747local items = {
3754 { 3748 {
@@ -3778,7 +3772,7 @@ for _index_0 = 1, #items do
3778 local width = item.width 3772 local width = item.width
3779 local height = item.height 3773 local height = item.height
3780 if width ~= nil and height ~= nil then 3774 if width ~= nil and height ~= nil then
3781 print("size " .. tostring(width) .. ", " .. tostring(height)) 3775 print("tamanho " .. tostring(width) .. ", " .. tostring(height))
3782 end 3776 end
3783 end 3777 end
3784 end 3778 end
@@ -3855,7 +3849,7 @@ if _tab_0 then
3855 local result = _exp_0.result 3849 local result = _exp_0.result
3856 if true == _exp_0.success and result ~= nil then 3850 if true == _exp_0.success and result ~= nil then
3857 _match_0 = true 3851 _match_0 = true
3858 print("success", result) 3852 print("sucesso", result)
3859 end 3853 end
3860end 3854end
3861if not _match_0 then 3855if not _match_0 then
@@ -3863,11 +3857,11 @@ if not _match_0 then
3863 if _tab_0 then 3857 if _tab_0 then
3864 if false == _exp_0.success then 3858 if false == _exp_0.success then
3865 _match_1 = true 3859 _match_1 = true
3866 print("failed", result) 3860 print("falhou", result)
3867 end 3861 end
3868 end 3862 end
3869 if not _match_1 then 3863 if not _match_1 then
3870 print("invalid") 3864 print("inválido")
3871 end 3865 end
3872end 3866end
3873local _exp_0 = tb 3867local _exp_0 = tb
@@ -3892,7 +3886,7 @@ if _tab_0 then
3892 end 3886 end
3893 if "success" == _val_0 and content ~= nil then 3887 if "success" == _val_0 and content ~= nil then
3894 _match_0 = true 3888 _match_0 = true
3895 print("success", content) 3889 print("sucesso", content)
3896 end 3890 end
3897end 3891end
3898if not _match_0 then 3892if not _match_0 then
@@ -3915,11 +3909,11 @@ if not _match_0 then
3915 end 3909 end
3916 if "error" == _val_0 and content ~= nil then 3910 if "error" == _val_0 and content ~= nil then
3917 _match_1 = true 3911 _match_1 = true
3918 print("failed", content) 3912 print("erro", content)
3919 end 3913 end
3920 end 3914 end
3921 if not _match_1 then 3915 if not _match_1 then
3922 print("invalid") 3916 print("inválido")
3923 end 3917 end
3924end 3918end
3925local _exp_0 = tb 3919local _exp_0 = tb
@@ -3970,7 +3964,7 @@ if _tab_0 then
3970 end 3964 end
3971 end 3965 end
3972 if 1 == _val_0 and 2 == _val_1 and 3 == _val_2 and 4 == _val_3 and 5 == _val_4 and 6 == _val_5 and fourth ~= nil then 3966 if 1 == _val_0 and 2 == _val_1 and 3 == _val_2 and 4 == _val_3 and 5 == _val_4 and 6 == _val_5 and fourth ~= nil then
3973 print("matched", fourth) 3967 print("correspondido", fourth)
3974 end 3968 end
3975end 3969end
3976local segments = { 3970local segments = {
@@ -3997,9 +3991,9 @@ if _tab_0 then
3997 local resource = segments[#segments - 1] 3991 local resource = segments[#segments - 1]
3998 local action = segments[#segments] 3992 local action = segments[#segments]
3999 if resource ~= nil and action ~= nil then 3993 if resource ~= nil and action ~= nil then
4000 print("Group:", groups) 3994 print("Grupo:", groups)
4001 print("Resource:", resource) 3995 print("Recurso:", resource)
4002 print("Action:", action) 3996 print("Ação:", action)
4003 end 3997 end
4004end 3998end
4005local i = 10 3999local i = 10
@@ -4288,8 +4282,8 @@ f = function(...)
4288 n = select("#", ...), 4282 n = select("#", ...),
4289 ... 4283 ...
4290 } 4284 }
4291 print("argument count:", t.n) 4285 print("contagem de argumentos:", t.n)
4292 print("table length:", #t) 4286 print("comprimento da tabela:", #t)
4293 for i = 1, t.n do 4287 for i = 1, t.n do
4294 print(t[i]) 4288 print(t[i])
4295 end 4289 end
@@ -4472,8 +4466,8 @@ f = function(...)
4472 n = select("#", ...), 4466 n = select("#", ...),
4473 ... 4467 ...
4474 } 4468 }
4475 print("argument count:", t.n) 4469 print("contagem de argumentos:", t.n)
4476 print("table length:", #t) 4470 print("comprimento da tabela:", #t)
4477 for i = 1, t.n do 4471 for i = 1, t.n do
4478 print(t[i]) 4472 print(t[i])
4479 end 4473 end
@@ -4519,7 +4513,7 @@ func(3000, "192.168.1.1")
4519local a <const> = 123 4513local a <const> = 123
4520local _ <close> = setmetatable({ }, { 4514local _ <close> = setmetatable({ }, {
4521 __close = function() 4515 __close = function()
4522 return print("Out of scope.") 4516 return print("Fora do escopo.")
4523 end 4517 end
4524}) 4518})
4525local a, b, c, d 4519local a, b, c, d
@@ -4529,7 +4523,7 @@ Constant = 123
4529local a <const> = 123 4523local a <const> = 123
4530local _ <close> = setmetatable({ }, { 4524local _ <close> = setmetatable({ }, {
4531 __close = function() 4525 __close = function()
4532 return print("Out of scope.") 4526 return print("Fora do escopo.")
4533 end 4527 end
4534}) 4528})
4535local a, b, c, d 4529local a, b, c, d
@@ -4688,7 +4682,7 @@ local d = a + b + c
4688print(d.value) 4682print(d.value)
4689local _ <close> = setmetatable({ }, { 4683local _ <close> = setmetatable({ }, {
4690 __close = function() 4684 __close = function()
4691 return print("out of scope") 4685 return print("fora do escopo")
4692 end 4686 end
4693}) 4687})
4694local tb = setmetatable({ }, { 4688local tb = setmetatable({ }, {
@@ -4981,7 +4975,7 @@ local d = a + b + c
4981print(d.value) 4975print(d.value)
4982local _ <close> = setmetatable({ }, { 4976local _ <close> = setmetatable({ }, {
4983 __close = function() 4977 __close = function()
4984 return print("out of scope") 4978 return print("fora do escopo")
4985 end 4979 end
4986}) 4980})
4987local tb = setmetatable({ }, { 4981local tb = setmetatable({ }, {
@@ -5122,8 +5116,8 @@ local tb = {
5122 } 5116 }
5123 } 5117 }
5124} 5118}
5125local some_string = "Here is a string\n that has a line break in it." 5119local some_string = "Aqui es uma string\n que tem uma quebra de linha."
5126print("I am " .. tostring(math.random() * 100) .. "% sure.") 5120print("Tenho " .. tostring(math.random() * 100) .. "% de certeza.")
5127local integer = 1000000 5121local integer = 1000000
5128local hex = 0xEFBBBF 5122local hex = 0xEFBBBF
5129local binary = 19 5123local binary = 19
@@ -5133,9 +5127,9 @@ fn = function()
5133 local str = "foo:\n bar: baz" 5127 local str = "foo:\n bar: baz"
5134 return str 5128 return str
5135end 5129end
5136local str = "path: \"C:\\Program Files\\App\"\nnote: 'He said: \"" .. tostring(Hello) .. "!\"'" 5130local str = "path: \"C:\\Program Files\\App\"\nnote: 'Ele disse: \"" .. tostring(Hello) .. "!\"'"
5137local some_string = "Here is a string\n that has a line break in it." 5131local some_string = "Aqui es uma string\n que tem uma quebra de linha."
5138print("I am " .. tostring(math.random() * 100) .. "% sure.") 5132print("Tenho " .. tostring(math.random() * 100) .. "% de certeza.")
5139local integer = 1000000 5133local integer = 1000000
5140local hex = 0xEFBBBF 5134local hex = 0xEFBBBF
5141local binary = 19 5135local binary = 19
@@ -5145,4 +5139,4 @@ fn = function()
5145 local str = "foo:\n bar: baz" 5139 local str = "foo:\n bar: baz"
5146 return str 5140 return str
5147end 5141end
5148local str = "path: \"C:\\Program Files\\App\"\nnote: 'He said: \"" .. tostring(Hello) .. "!\"'" 5142local str = "path: \"C:\\Program Files\\App\"\nnote: 'Ele disse: \"" .. tostring(Hello) .. "!\"'"