diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-08-15 16:16:59 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2024-08-15 16:16:59 +0800 |
commit | 2fe2ff371a8d2ee97a46c1b48eb421d9f8ee65ad (patch) | |
tree | 2e3b0bd509874ee32829378d12ad411e186fbebe | |
parent | 464aad2e42c2d6492eb60dca8049e3d86f89b489 (diff) | |
download | lua-language-server-2fe2ff371a8d2ee97a46c1b48eb421d9f8ee65ad.zip |
fix Incorrect LuaCats parsing for `"'"`
fix #2757
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/parser/luadoc.lua | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md index 8ada9c72..c66283cd 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ <!-- Add all new changes here. They will be moved under a version at release --> * `NEW` Add matching checks between the shape of tables and classes, during type checking. [#2768](https://github.com/LuaLS/lua-language-server/pull/2768) * `FIX` Error `attempt to index a nil value` when `Lua.hint.semicolon == 'All'` [#2788](https://github.com/LuaLS/lua-language-server/issues/2788) +* `FIX` Incorrect LuaCats parsing for `"'"` ## 3.10.3 `2024-8-8` diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 7fd73c91..2ae24cca 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -674,7 +674,7 @@ local function parseString(parent) -- compatibility if content:sub(1, 1) == '"' or content:sub(1, 1) == "'" then - if content:sub(1, 1) == content:sub(-1, -1) then + if #content > 1 and content:sub(1, 1) == content:sub(-1, -1) then mark = content:sub(1, 1) content = content:sub(2, -2) end |