diff options
Diffstat (limited to 'spec/outputs/codes_from_doc_pt-br.lua')
| -rw-r--r-- | spec/outputs/codes_from_doc_pt-br.lua | 226 |
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" |
| 94 | end | 94 | end |
| 95 | do | 95 | do |
| 96 | -- raw Lua codes insertion | 96 | -- inserção de códigos Lua brutos |
| 97 | if cond then | 97 | if cond then |
| 98 | print("output") | 98 | print("output") |
| 99 | end | 99 | end |
| @@ -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" |
| 133 | end | 133 | end |
| 134 | do | 134 | do |
| 135 | -- raw Lua codes insertion | 135 | -- inserção de códigos Lua brutos |
| 136 | if cond then | 136 | if cond then |
| 137 | print("output") | 137 | print("output") |
| 138 | end | 138 | end |
| @@ -2476,7 +2476,7 @@ x = x * 10 | |||
| 2476 | x = x / 10 | 2476 | x = x / 10 |
| 2477 | x = x % 10 | 2477 | x = x % 10 |
| 2478 | local s = s .. "world" | 2478 | local s = s .. "world" |
| 2479 | local arg = arg or "default value" | 2479 | local arg = arg or "valor padrão" |
| 2480 | local a = 0 | 2480 | local a = 0 |
| 2481 | local b = 0 | 2481 | local b = 0 |
| 2482 | local c = 0 | 2482 | local c = 0 |
| @@ -2488,7 +2488,7 @@ local z = x | |||
| 2488 | do | 2488 | do |
| 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 | |||
| 2498 | do | 2498 | do |
| 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 |
| 2504 | end | 2504 | end |
| 2505 | do | 2505 | do |
| 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 | |||
| 2512 | end | 2512 | end |
| 2513 | do | 2513 | do |
| 2514 | X = 1 | 2514 | X = 1 |
| 2515 | print("only declare upper case variables as globals") | 2515 | print("declarar apenas variáveis em maiúsculas 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" |
| 2519 | end | 2519 | end |
| 2520 | local hello = "world" | 2520 | local hello = "world" |
| 2521 | local a, b, c = 1, 2, 3 | 2521 | local a, b, c = 1, 2, 3 |
| @@ -2527,7 +2527,7 @@ x = x * 10 | |||
| 2527 | x = x / 10 | 2527 | x = x / 10 |
| 2528 | x = x % 10 | 2528 | x = x % 10 |
| 2529 | local s = s .. "world" | 2529 | local s = s .. "world" |
| 2530 | local arg = arg or "default value" | 2530 | local arg = arg or "valor padrão" |
| 2531 | local a = 0 | 2531 | local a = 0 |
| 2532 | local b = 0 | 2532 | local b = 0 |
| 2533 | local c = 0 | 2533 | local c = 0 |
| @@ -2539,7 +2539,7 @@ local z = x | |||
| 2539 | do | 2539 | do |
| 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 | |||
| 2549 | do | 2549 | do |
| 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 |
| 2555 | end | 2555 | end |
| 2556 | do | 2556 | do |
| 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 | |||
| 2563 | end | 2563 | end |
| 2564 | do | 2564 | do |
| 2565 | X = 1 | 2565 | X = 1 |
| 2566 | print("only declare upper case variables as globals") | 2566 | print("declarar apenas variáveis em maiúsculas 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" |
| 2570 | end | 2570 | end |
| 2571 | local list = { | 2571 | local list = { |
| 2572 | 1, | 2572 | 1, |
| @@ -2608,18 +2608,18 @@ if user then | |||
| 2608 | end | 2608 | end |
| 2609 | local hello = os.getenv("hello") | 2609 | local hello = os.getenv("hello") |
| 2610 | if hello then | 2610 | if hello then |
| 2611 | print("You have hello", hello) | 2611 | print("Você tem hello", hello) |
| 2612 | else | 2612 | else |
| 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("você tem world", world) |
| 2616 | else | 2616 | else |
| 2617 | print("nothing :(") | 2617 | print("nada :(") |
| 2618 | end | 2618 | end |
| 2619 | end | 2619 | end |
| 2620 | do | 2620 | do |
| 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 | |||
| 2640 | end | 2640 | end |
| 2641 | local hello = os.getenv("hello") | 2641 | local hello = os.getenv("hello") |
| 2642 | if hello then | 2642 | if hello then |
| 2643 | print("You have hello", hello) | 2643 | print("Você tem hello", hello) |
| 2644 | else | 2644 | else |
| 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("você tem world", world) |
| 2648 | else | 2648 | else |
| 2649 | print("nothing :(") | 2649 | print("nada :(") |
| 2650 | end | 2650 | end |
| 2651 | end | 2651 | end |
| 2652 | do | 2652 | do |
| 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 | |||
| 2707 | local _obj_0 = person | 2707 | local _obj_0 = person |
| 2708 | name, job = _obj_0.name, _obj_0.job | 2708 | name, job = _obj_0.name, _obj_0.job |
| 2709 | if name == nil then | 2709 | if name == nil then |
| 2710 | name = "nameless" | 2710 | name = "sem nome" |
| 2711 | end | 2711 | end |
| 2712 | if job == nil then | 2712 | if job == nil then |
| 2713 | job = "jobless" | 2713 | job = "sem emprego" |
| 2714 | end | 2714 | end |
| 2715 | local two, four | 2715 | local two, four |
| 2716 | local _obj_0 = items | 2716 | local _obj_0 = items |
| @@ -2824,10 +2824,10 @@ local name, job | |||
| 2824 | local _obj_0 = person | 2824 | local _obj_0 = person |
| 2825 | name, job = _obj_0.name, _obj_0.job | 2825 | name, job = _obj_0.name, _obj_0.job |
| 2826 | if name == nil then | 2826 | if name == nil then |
| 2827 | name = "nameless" | 2827 | name = "sem nome" |
| 2828 | end | 2828 | end |
| 2829 | if job == nil then | 2829 | if job == nil then |
| 2830 | job = "jobless" | 2830 | job = "sem emprego" |
| 2831 | end | 2831 | end |
| 2832 | local two, four | 2832 | local two, four |
| 2833 | local _obj_0 = items | 2833 | local _obj_0 = items |
| @@ -3031,7 +3031,7 @@ local apple = setmetatable({ | |||
| 3031 | if (getmetatable(apple) ~= nil) then | 3031 | if (getmetatable(apple) ~= nil) then |
| 3032 | p(apple.size, apple.color, getmetatable(apple).__index) | 3032 | p(apple.size, apple.color, getmetatable(apple).__index) |
| 3033 | end | 3033 | end |
| 3034 | local _u1f31b = "月之脚本" | 3034 | local _u1f31b = "Script da Lua" |
| 3035 | _module_0["🌛"] = _u1f31b | 3035 | _module_0["🌛"] = _u1f31b |
| 3036 | return _module_0 | 3036 | return _module_0 |
| 3037 | local _module_0 = { } | 3037 | local _module_0 = { } |
| @@ -3109,27 +3109,27 @@ local apple = setmetatable({ | |||
| 3109 | if (getmetatable(apple) ~= nil) then | 3109 | if (getmetatable(apple) ~= nil) then |
| 3110 | p(apple.size, apple.color, getmetatable(apple).__index) | 3110 | p(apple.size, apple.color, getmetatable(apple).__index) |
| 3111 | end | 3111 | end |
| 3112 | local _u1f31b = "月之脚本" | 3112 | local _u1f31b = "Script da Lua" |
| 3113 | _module_0["🌛"] = _u1f31b | 3113 | _module_0["🌛"] = _u1f31b |
| 3114 | return _module_0 | 3114 | return _module_0 |
| 3115 | local have_coins = false | 3115 | local have_coins = false |
| 3116 | if have_coins then | 3116 | if have_coins then |
| 3117 | print("Got coins") | 3117 | print("Tem moedas") |
| 3118 | else | 3118 | else |
| 3119 | print("No coins") | 3119 | print("Sem moedas") |
| 3120 | end | 3120 | end |
| 3121 | local have_coins = false | 3121 | local have_coins = false |
| 3122 | if have_coins then | 3122 | if have_coins then |
| 3123 | print("Got coins") | 3123 | print("Tem moedas") |
| 3124 | else | 3124 | else |
| 3125 | print("No coins") | 3125 | print("Sem moedas") |
| 3126 | end | 3126 | end |
| 3127 | local have_coins = false | 3127 | local have_coins = false |
| 3128 | print((function() | 3128 | print((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 |
| 3134 | end)()) | 3134 | end)()) |
| 3135 | local is_tall | 3135 | local is_tall |
| @@ -3142,20 +3142,20 @@ is_tall = function(name) | |||
| 3142 | end | 3142 | end |
| 3143 | local message | 3143 | local message |
| 3144 | if is_tall("Rob") then | 3144 | if is_tall("Rob") then |
| 3145 | message = "I am very tall" | 3145 | message = "Sou muito alto" |
| 3146 | else | 3146 | else |
| 3147 | message = "I am not so tall" | 3147 | message = "Não sou tão alto" |
| 3148 | end | 3148 | end |
| 3149 | print(message) | 3149 | print(message) |
| 3150 | if not (os.date("%A") == "Monday") then | 3150 | if not (os.date("%A") == "Monday") then |
| 3151 | print("it is not Monday!") | 3151 | print("não é segunda-feira!") |
| 3152 | end | 3152 | end |
| 3153 | if not (math.random() > 0.1) then | 3153 | if not (math.random() > 0.1) then |
| 3154 | print("You're lucky!") | 3154 | print("Você tem sorte!") |
| 3155 | end | 3155 | end |
| 3156 | local a = 5 | 3156 | local a = 5 |
| 3157 | if (1 == a or 3 == a or 5 == a or 7 == a) then | 3157 | if (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") |
| 3159 | end | 3159 | end |
| 3160 | if (function() | 3160 | if (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 |
| 3168 | end)() then | 3168 | end)() then |
| 3169 | print("checking if `a` is in a list") | 3169 | print("verificando se `a` está na lista") |
| 3170 | end | ||
| 3171 | if not (math.random() > 0.1) then | ||
| 3172 | print("You're lucky!") | ||
| 3173 | end | 3170 | end |
| 3174 | local have_coins = false | 3171 | local have_coins = false |
| 3175 | if have_coins then | 3172 | if have_coins then |
| 3176 | print("Got coins") | 3173 | print("Tem moedas") |
| 3177 | else | 3174 | else |
| 3178 | print("No coins") | 3175 | print("Sem moedas") |
| 3179 | end | 3176 | end |
| 3180 | local have_coins = false | 3177 | local have_coins = false |
| 3181 | if have_coins then | 3178 | if have_coins then |
| 3182 | print("Got coins") | 3179 | print("Tem moedas") |
| 3183 | else | 3180 | else |
| 3184 | print("No coins") | 3181 | print("Sem moedas") |
| 3185 | end | 3182 | end |
| 3186 | local have_coins = false | 3183 | local have_coins = false |
| 3187 | print((function() | 3184 | print((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 |
| 3193 | end)()) | 3190 | end)()) |
| 3194 | local is_tall | 3191 | local is_tall |
| @@ -3201,20 +3198,20 @@ is_tall = function(name) | |||
| 3201 | end | 3198 | end |
| 3202 | local message | 3199 | local message |
| 3203 | if is_tall("Rob") then | 3200 | if is_tall("Rob") then |
| 3204 | message = "I am very tall" | 3201 | message = "Sou muito alto" |
| 3205 | else | 3202 | else |
| 3206 | message = "I am not so tall" | 3203 | message = "Não sou tão alto" |
| 3207 | end | 3204 | end |
| 3208 | print(message) | 3205 | print(message) |
| 3209 | if not (os.date("%A") == "Monday") then | 3206 | if not (os.date("%A") == "Monday") then |
| 3210 | print("it is not Monday!") | 3207 | print("não é segunda-feira!") |
| 3211 | end | 3208 | end |
| 3212 | if not (math.random() > 0.1) then | 3209 | if not (math.random() > 0.1) then |
| 3213 | print("You're lucky!") | 3210 | print("Você tem sorte!") |
| 3214 | end | 3211 | end |
| 3215 | local a = 5 | 3212 | local a = 5 |
| 3216 | if (1 == a or 3 == a or 5 == a or 7 == a) then | 3213 | if (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") |
| 3218 | end | 3215 | end |
| 3219 | if (function() | 3216 | if (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 |
| 3227 | end)() then | 3224 | end)() then |
| 3228 | print("checking if `a` is in a list") | 3225 | print("verificando se `a` está na lista") |
| 3229 | end | ||
| 3230 | if not (math.random() > 0.1) then | ||
| 3231 | print("You're lucky!") | ||
| 3232 | end | 3226 | end |
| 3233 | for i = 10, 20 do | 3227 | for i = 10, 20 do |
| 3234 | print(i) | 3228 | print(i) |
| @@ -3420,11 +3414,11 @@ end | |||
| 3420 | odds = _accum_0 | 3414 | odds = _accum_0 |
| 3421 | local name = "Dan" | 3415 | local name = "Dan" |
| 3422 | if "Robert" == name then | 3416 | if "Robert" == name then |
| 3423 | print("You are Robert") | 3417 | print("Você é Robert") |
| 3424 | elseif "Dan" == name or "Daniel" == name then | 3418 | elseif "Dan" == name or "Daniel" == name then |
| 3425 | print("Your name, it's Dan") | 3419 | print("Seu nome é Dan") |
| 3426 | else | 3420 | else |
| 3427 | print("I don't know about you with name " .. tostring(name)) | 3421 | print("Não sei quem você é com o nome " .. tostring(name)) |
| 3428 | end | 3422 | end |
| 3429 | local b = 1 | 3423 | local b = 1 |
| 3430 | local next_number | 3424 | local next_number |
| @@ -3433,30 +3427,30 @@ if 1 == b then | |||
| 3433 | elseif 2 == b then | 3427 | elseif 2 == b then |
| 3434 | next_number = 3 | 3428 | next_number = 3 |
| 3435 | else | 3429 | else |
| 3436 | next_number = error("can't count that high!") | 3430 | next_number = error("não consigo contar tão alto!") |
| 3437 | end | 3431 | end |
| 3438 | local msg | 3432 | local msg |
| 3439 | local _exp_0 = math.random(1, 5) | 3433 | local _exp_0 = math.random(1, 5) |
| 3440 | if 1 == _exp_0 then | 3434 | if 1 == _exp_0 then |
| 3441 | msg = "you are lucky" | 3435 | msg = "você tem sorte" |
| 3442 | elseif 2 == _exp_0 then | 3436 | elseif 2 == _exp_0 then |
| 3443 | msg = "you are almost lucky" | 3437 | msg = "você quase tem sorte" |
| 3444 | else | 3438 | else |
| 3445 | msg = "not so lucky" | 3439 | msg = "não tão sortudo" |
| 3446 | end | 3440 | end |
| 3447 | do | 3441 | do |
| 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("você tem sorte") |
| 3451 | else | 3445 | else |
| 3452 | print("not so lucky") | 3446 | print("não tão sortudo") |
| 3453 | end | 3447 | end |
| 3454 | end | 3448 | end |
| 3455 | local _exp_0 = math.random(1, 5) | 3449 | local _exp_0 = math.random(1, 5) |
| 3456 | if 1 == _exp_0 then | 3450 | if 1 == _exp_0 then |
| 3457 | print("you are lucky") | 3451 | print("você tem sorte") |
| 3458 | else | 3452 | else |
| 3459 | print("not so lucky") | 3453 | print("não tão sortudo") |
| 3460 | end | 3454 | end |
| 3461 | local items = { | 3455 | local 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 |
| 3568 | end | 3562 | end |
| 3569 | if not _match_0 then | 3563 | if 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 |
| 3580 | end | 3574 | end |
| 3581 | local _exp_0 = tb | 3575 | local _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 |
| 3605 | end | 3599 | end |
| 3606 | if not _match_0 then | 3600 | if 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 |
| 3632 | end | 3626 | end |
| 3633 | local _exp_0 = tb | 3627 | local _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 |
| 3683 | end | 3677 | end |
| 3684 | local segments = { | 3678 | local 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 |
| 3712 | end | 3706 | end |
| 3713 | local name = "Dan" | 3707 | local name = "Dan" |
| 3714 | if "Robert" == name then | 3708 | if "Robert" == name then |
| 3715 | print("You are Robert") | 3709 | print("Você é Robert") |
| 3716 | elseif "Dan" == name or "Daniel" == name then | 3710 | elseif "Dan" == name or "Daniel" == name then |
| 3717 | print("Your name, it's Dan") | 3711 | print("Seu nome é Dan") |
| 3718 | else | 3712 | else |
| 3719 | print("I don't know about you with name " .. tostring(name)) | 3713 | print("Não sei quem você é com o nome " .. tostring(name)) |
| 3720 | end | 3714 | end |
| 3721 | local b = 1 | 3715 | local b = 1 |
| 3722 | local next_number | 3716 | local next_number |
| @@ -3725,30 +3719,30 @@ if 1 == b then | |||
| 3725 | elseif 2 == b then | 3719 | elseif 2 == b then |
| 3726 | next_number = 3 | 3720 | next_number = 3 |
| 3727 | else | 3721 | else |
| 3728 | next_number = error("can't count that high!") | 3722 | next_number = error("não consigo contar tão alto!") |
| 3729 | end | 3723 | end |
| 3730 | local msg | 3724 | local msg |
| 3731 | local _exp_0 = math.random(1, 5) | 3725 | local _exp_0 = math.random(1, 5) |
| 3732 | if 1 == _exp_0 then | 3726 | if 1 == _exp_0 then |
| 3733 | msg = "you are lucky" | 3727 | msg = "você tem sorte" |
| 3734 | elseif 2 == _exp_0 then | 3728 | elseif 2 == _exp_0 then |
| 3735 | msg = "you are almost lucky" | 3729 | msg = "você quase tem sorte" |
| 3736 | else | 3730 | else |
| 3737 | msg = "not so lucky" | 3731 | msg = "não tão sortudo" |
| 3738 | end | 3732 | end |
| 3739 | do | 3733 | do |
| 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("você tem sorte") |
| 3743 | else | 3737 | else |
| 3744 | print("not so lucky") | 3738 | print("não tão sortudo") |
| 3745 | end | 3739 | end |
| 3746 | end | 3740 | end |
| 3747 | local _exp_0 = math.random(1, 5) | 3741 | local _exp_0 = math.random(1, 5) |
| 3748 | if 1 == _exp_0 then | 3742 | if 1 == _exp_0 then |
| 3749 | print("you are lucky") | 3743 | print("você tem sorte") |
| 3750 | else | 3744 | else |
| 3751 | print("not so lucky") | 3745 | print("não tão sortudo") |
| 3752 | end | 3746 | end |
| 3753 | local items = { | 3747 | local 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 |
| 3860 | end | 3854 | end |
| 3861 | if not _match_0 then | 3855 | if 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 |
| 3872 | end | 3866 | end |
| 3873 | local _exp_0 = tb | 3867 | local _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 |
| 3897 | end | 3891 | end |
| 3898 | if not _match_0 then | 3892 | if 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 |
| 3924 | end | 3918 | end |
| 3925 | local _exp_0 = tb | 3919 | local _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 |
| 3975 | end | 3969 | end |
| 3976 | local segments = { | 3970 | local 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 |
| 4004 | end | 3998 | end |
| 4005 | local i = 10 | 3999 | local 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") | |||
| 4519 | local a <const> = 123 | 4513 | local a <const> = 123 |
| 4520 | local _ <close> = setmetatable({ }, { | 4514 | local _ <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 | }) |
| 4525 | local a, b, c, d | 4519 | local a, b, c, d |
| @@ -4529,7 +4523,7 @@ Constant = 123 | |||
| 4529 | local a <const> = 123 | 4523 | local a <const> = 123 |
| 4530 | local _ <close> = setmetatable({ }, { | 4524 | local _ <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 | }) |
| 4535 | local a, b, c, d | 4529 | local a, b, c, d |
| @@ -4688,7 +4682,7 @@ local d = a + b + c | |||
| 4688 | print(d.value) | 4682 | print(d.value) |
| 4689 | local _ <close> = setmetatable({ }, { | 4683 | local _ <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 | }) |
| 4694 | local tb = setmetatable({ }, { | 4688 | local tb = setmetatable({ }, { |
| @@ -4981,7 +4975,7 @@ local d = a + b + c | |||
| 4981 | print(d.value) | 4975 | print(d.value) |
| 4982 | local _ <close> = setmetatable({ }, { | 4976 | local _ <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 | }) |
| 4987 | local tb = setmetatable({ }, { | 4981 | local tb = setmetatable({ }, { |
| @@ -5122,8 +5116,8 @@ local tb = { | |||
| 5122 | } | 5116 | } |
| 5123 | } | 5117 | } |
| 5124 | } | 5118 | } |
| 5125 | local some_string = "Here is a string\n that has a line break in it." | 5119 | local some_string = "Aqui está uma string\n que tem uma quebra de linha." |
| 5126 | print("I am " .. tostring(math.random() * 100) .. "% sure.") | 5120 | print("Tenho " .. tostring(math.random() * 100) .. "% de certeza.") |
| 5127 | local integer = 1000000 | 5121 | local integer = 1000000 |
| 5128 | local hex = 0xEFBBBF | 5122 | local hex = 0xEFBBBF |
| 5129 | local binary = 19 | 5123 | local 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 |
| 5135 | end | 5129 | end |
| 5136 | local str = "path: \"C:\\Program Files\\App\"\nnote: 'He said: \"" .. tostring(Hello) .. "!\"'" | 5130 | local str = "path: \"C:\\Program Files\\App\"\nnote: 'Ele disse: \"" .. tostring(Hello) .. "!\"'" |
| 5137 | local some_string = "Here is a string\n that has a line break in it." | 5131 | local some_string = "Aqui está uma string\n que tem uma quebra de linha." |
| 5138 | print("I am " .. tostring(math.random() * 100) .. "% sure.") | 5132 | print("Tenho " .. tostring(math.random() * 100) .. "% de certeza.") |
| 5139 | local integer = 1000000 | 5133 | local integer = 1000000 |
| 5140 | local hex = 0xEFBBBF | 5134 | local hex = 0xEFBBBF |
| 5141 | local binary = 19 | 5135 | local 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 |
| 5147 | end | 5141 | end |
| 5148 | local str = "path: \"C:\\Program Files\\App\"\nnote: 'He said: \"" .. tostring(Hello) .. "!\"'" | 5142 | local str = "path: \"C:\\Program Files\\App\"\nnote: 'Ele disse: \"" .. tostring(Hello) .. "!\"'" |
