From a092802f958780282ae34f3cccc3cc8ce2263ac9 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 18 Jul 2025 16:13:02 +0800 Subject: Fixes. --- spec/outputs/codes_from_doc.lua | 26 ++++++++++++++++++++++++++ spec/outputs/codes_from_doc_zh.lua | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) (limited to 'spec') diff --git a/spec/outputs/codes_from_doc.lua b/spec/outputs/codes_from_doc.lua index f1e46d9..b7d1236 100644 --- a/spec/outputs/codes_from_doc.lua +++ b/spec/outputs/codes_from_doc.lua @@ -109,6 +109,12 @@ end print("yuescript") print(3) print("Valid enum type:", "Static") +do + print(123, "hello") +end +do + print(123, "hello") +end if tb ~= nil then tb:func() end @@ -816,6 +822,13 @@ print("I am " .. tostring(math.random() * 100) .. "% sure.") local integer = 1000000 local hex = 0xEFBBBF local binary = 19 +local str = "key: value\nlist:\n - item1\n - " .. tostring(expr) +local fn +fn = function() + local str = "foo:\n bar: baz" + return str +end +local str = "path: \"C:\\Program Files\\App\"\nnote: 'He said: \"" .. tostring(Hello) .. "!\"'" local my_function my_function = function() end my_function() @@ -2505,6 +2518,12 @@ end print("yuescript") print(3) print("Valid enum type:", "Static") +do + print(123, "hello") +end +do + print(123, "hello") +end if tb ~= nil then tb:func() end @@ -3212,6 +3231,13 @@ print("I am " .. tostring(math.random() * 100) .. "% sure.") local integer = 1000000 local hex = 0xEFBBBF local binary = 19 +local str = "key: value\nlist:\n - item1\n - " .. tostring(expr) +local fn +fn = function() + local str = "foo:\n bar: baz" + return str +end +local str = "path: \"C:\\Program Files\\App\"\nnote: 'He said: \"" .. tostring(Hello) .. "!\"'" local my_function my_function = function() end my_function() diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua index 4689232..b54d6d7 100644 --- a/spec/outputs/codes_from_doc_zh.lua +++ b/spec/outputs/codes_from_doc_zh.lua @@ -109,6 +109,12 @@ end print("yuescript") print(3) print("有效的枚举类型:", "Static") +do + print(123, "hello") +end +do + print(123, "hello") +end if tb ~= nil then tb:func() end @@ -816,6 +822,13 @@ print("我有" .. tostring(math.random() * 100) .. "%的把握。") local integer = 1000000 local hex = 0xEFBBBF local binary = 19 +local str = "key: value\nlist:\n - item1\n - " .. tostring(expr) +local fn +fn = function() + local str = "foo:\n bar: baz" + return str +end +local str = "path: \"C:\\Program Files\\App\"\nnote: 'He said: \"" .. tostring(Hello) .. "!\"'" local my_function my_function = function() end my_function() @@ -2499,6 +2512,12 @@ end print("yuescript") print(3) print("有效的枚举类型:", "Static") +do + print(123, "hello") +end +do + print(123, "hello") +end if tb ~= nil then tb:func() end @@ -3206,6 +3225,13 @@ print("我有" .. tostring(math.random() * 100) .. "%的把握。") local integer = 1000000 local hex = 0xEFBBBF local binary = 19 +local str = "key: value\nlist:\n - item1\n - " .. tostring(expr) +local fn +fn = function() + local str = "foo:\n bar: baz" + return str +end +local str = "path: \"C:\\Program Files\\App\"\nnote: 'He said: \"" .. tostring(Hello) .. "!\"'" local my_function my_function = function() end my_function() -- cgit v1.2.3-55-g6feb