From 0ec7d6e7152cf6325a3acba13b1807efe0939dba Mon Sep 17 00:00:00 2001
From: Li Jin <dragon-fly@qq.com>
Date: Thu, 2 Mar 2023 17:36:37 +0800
Subject: add missing config option from #126.

---
 src/yuescript/yue_compiler.cpp | 2 +-
 src/yuescript/yuescript.cpp    | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

(limited to 'src')

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 = {
 	"close"s // Lua 5.4
 };
 
-const std::string_view version = "0.15.27"sv;
+const std::string_view version = "0.15.28"sv;
 const std::string_view extension = "yue"sv;
 
 class 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) {
 			config.reserveLineNumber = lua_toboolean(L, -1) != 0;
 		}
 		lua_pop(L, 1);
+		lua_pushliteral(L, "reserve_comment");
+		lua_gettable(L, -2);
+		if (lua_isboolean(L, -1) != 0) {
+			config.reserveComment = lua_toboolean(L, -1) != 0;
+		}
+		lua_pop(L, 1);
 		lua_pushliteral(L, "space_over_tab");
 		lua_gettable(L, -2);
 		if (lua_isboolean(L, -1) != 0) {
-- 
cgit v1.2.3-55-g6feb