From f8461ac8a4bb1cdc7f9a28144a5837a4cdf0df50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 27 Jun 2022 16:37:18 +0800 Subject: fix --- script/parser/compile.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'script/parser/compile.lua') diff --git a/script/parser/compile.lua b/script/parser/compile.lua index cc142dfa..9db46241 100644 --- a/script/parser/compile.lua +++ b/script/parser/compile.lua @@ -553,11 +553,12 @@ local function skipComment(isAction) end Index = Index + 2 end + local right = Tokens[Index] and (Tokens[Index] - 1) or #Lua State.comms[#State.comms+1] = { type = chead and 'comment.cshort' or 'comment.short', start = left, - finish = lastRightPosition(), - text = ssub(Lua, start + 2, Tokens[Index] and (Tokens[Index] - 1) or #Lua), + finish = getPosition(right, 'right'), + text = ssub(Lua, start + 2, right), } return true end -- cgit v1.2.3