aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-03-02 17:36:37 +0800
committerLi Jin <dragon-fly@qq.com>2023-03-02 17:36:37 +0800
commit0ec7d6e7152cf6325a3acba13b1807efe0939dba (patch)
tree954ab01f267a915741951a01ed8d038a35c55098
parente66f56215614c4e1995d1e4369b01b0ebc7131b2 (diff)
downloadyuescript-0ec7d6e7152cf6325a3acba13b1807efe0939dba.tar.gz
yuescript-0ec7d6e7152cf6325a3acba13b1807efe0939dba.tar.bz2
yuescript-0ec7d6e7152cf6325a3acba13b1807efe0939dba.zip
add missing config option from #126.
-rw-r--r--src/yuescript/yue_compiler.cpp2
-rw-r--r--src/yuescript/yuescript.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp
index 52ed005..3a9e584 100644
--- a/src/yuescript/yue_compiler.cpp
+++ b/src/yuescript/yue_compiler.cpp
@@ -73,7 +73,7 @@ static std::unordered_set<std::string> Metamethods = {
73 "close"s // Lua 5.4 73 "close"s // Lua 5.4
74}; 74};
75 75
76const std::string_view version = "0.15.27"sv; 76const std::string_view version = "0.15.28"sv;
77const std::string_view extension = "yue"sv; 77const std::string_view extension = "yue"sv;
78 78
79class YueCompilerImpl { 79class YueCompilerImpl {
diff --git a/src/yuescript/yuescript.cpp b/src/yuescript/yuescript.cpp
index 3a17fa8..1a1752c 100644
--- a/src/yuescript/yuescript.cpp
+++ b/src/yuescript/yuescript.cpp
@@ -87,6 +87,12 @@ static int yuetolua(lua_State* L) {
87 config.reserveLineNumber = lua_toboolean(L, -1) != 0; 87 config.reserveLineNumber = lua_toboolean(L, -1) != 0;
88 } 88 }
89 lua_pop(L, 1); 89 lua_pop(L, 1);
90 lua_pushliteral(L, "reserve_comment");
91 lua_gettable(L, -2);
92 if (lua_isboolean(L, -1) != 0) {
93 config.reserveComment = lua_toboolean(L, -1) != 0;
94 }
95 lua_pop(L, 1);
90 lua_pushliteral(L, "space_over_tab"); 96 lua_pushliteral(L, "space_over_tab");
91 lua_gettable(L, -2); 97 lua_gettable(L, -2);
92 if (lua_isboolean(L, -1) != 0) { 98 if (lua_isboolean(L, -1) != 0) {