Skip to content

Commit 36fc4fd

Browse files
committed
Updated spec.
1 parent 4e7cf4d commit 36fc4fd

7 files changed

Lines changed: 15 additions & 19 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ if (DEFINED ENV{ANDROID_ROOT})
7272
endif()
7373
endif()
7474

75-
if (APPLE)
76-
add_compile_options(-Wno-deprecated-declarations)
77-
endif ()
78-
7975
add_library(libyue MODULE
8076
src/yuescript/ast.cpp
8177
src/yuescript/parser.cpp

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SRC_PATH = ./src
1111
# Space-separated pkg-config libraries used by this project
1212
LIBS =
1313
# General compiler flags
14-
COMPILE_FLAGS = -std=c++17 -Wall -Wextra -Wno-deprecated-declarations -DYUE_UTF8_IMPL
14+
COMPILE_FLAGS = -std=c++17 -Wall -Wextra -DYUE_UTF8_IMPL
1515
# Additional release-specific flags
1616
RCOMPILE_FLAGS = -D NDEBUG -O3
1717
# Additional debug-specific flags

spec/outputs/codes_from_doc.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ local apple = setmetatable({
7373
if (getmetatable(apple) ~= nil) then
7474
p(apple.size, apple.color, getmetatable(apple).__index)
7575
end
76-
local _ud83c_udf1b = "月之脚本"
77-
_module_0["🌛"] = _ud83c_udf1b
76+
local _u1f31b = "月之脚本"
77+
_module_0["🌛"] = _u1f31b
7878
return _module_0
7979
local area = 6.2831853071796 * 5
8080
print('hello world')
@@ -2514,8 +2514,8 @@ local apple = setmetatable({
25142514
if (getmetatable(apple) ~= nil) then
25152515
p(apple.size, apple.color, getmetatable(apple).__index)
25162516
end
2517-
local _ud83c_udf1b = "月之脚本"
2518-
_module_0["🌛"] = _ud83c_udf1b
2517+
local _u1f31b = "月之脚本"
2518+
_module_0["🌛"] = _u1f31b
25192519
return _module_0
25202520
local area = 6.2831853071796 * 5
25212521
print('hello world')

spec/outputs/codes_from_doc_zh.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ local apple = setmetatable({
7373
if (getmetatable(apple) ~= nil) then
7474
p(apple.size, apple.color, getmetatable(apple).__index)
7575
end
76-
local _ud83c_udf1b = "月之脚本"
77-
_module_0["🌛"] = _ud83c_udf1b
76+
local _u1f31b = "月之脚本"
77+
_module_0["🌛"] = _u1f31b
7878
return _module_0
7979
local area = 6.2831853071796 * 5
8080
print('你好 世界')
@@ -2508,8 +2508,8 @@ local apple = setmetatable({
25082508
if (getmetatable(apple) ~= nil) then
25092509
p(apple.size, apple.color, getmetatable(apple).__index)
25102510
end
2511-
local _ud83c_udf1b = "月之脚本"
2512-
_module_0["🌛"] = _ud83c_udf1b
2511+
local _u1f31b = "月之脚本"
2512+
_module_0["🌛"] = _u1f31b
25132513
return _module_0
25142514
local area = 6.2831853071796 * 5
25152515
print('你好 世界')

spec/outputs/unicode/funcs.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ _u5f00(function()
2424
end)
2525
local _u53d8_u91cfh
2626
_u53d8_u91cfh = function()
27-
return _ud83d_udc4b
27+
return _u1f44b
2828
end
2929
_u5403(function() end, _u4e16_u754c);
3030
(function() end)()

spec/outputs/unicode/import.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ local _u5b57_u6bb5x, _u5b57_u6bb5y, _u5b57_u6bb5z = _u9053_u5177_u7ec4["字段x"
1111
return _fn_0(_base_0, ...)
1212
end
1313
end)(), _u9053_u5177_u7ec4["字段z"]
14-
local _u9886_u4e3b, _ud83d_udc7b
14+
local _u9886_u4e3b, _u1f47b
1515
do
1616
local _obj_1 = _u627e_u5230("我的表")
17-
_u9886_u4e3b, _ud83d_udc7b = _obj_1["领主"], (function()
17+
_u9886_u4e3b, _u1f47b = _obj_1["领主"], (function()
1818
local _base_0 = _obj_1
1919
local _fn_0 = _base_0["👻"]
2020
return _fn_0 and function(...)

src/yuescript/yue_compiler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,10 +1360,10 @@ class YueCompilerImpl {
13601360
std::ostringstream buf;
13611361
for (auto it = uname->m_begin.m_it; it != uname->m_end.m_it; ++it) {
13621362
auto ch = *it;
1363-
if (ch > 255) {
1364-
buf << "_u"sv << std::hex << static_cast<int>(ch);
1365-
} else {
1363+
if (ch <= 0x7F && ((ch == '_') || ((ch | 0x20) >= 'a' && (ch | 0x20) <= 'z') || (ch >= '0' && ch <= '9'))) {
13661364
buf << static_cast<char>(ch);
1365+
} else {
1366+
buf << "_u"sv << std::hex << static_cast<uint32_t>(ch);
13671367
}
13681368
}
13691369
return buf.str();

0 commit comments

Comments
 (0)