summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-02 15:08:07 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-02 15:08:07 +0800
commitd7e96432ccd7f736c0f269ccca68cf4b840927db (patch)
tree4553b30cfdba02b603e9ed73edbdbca0fd9c3525 /script/parser
parent310b96f3e4b285a3a8422745ab01a32ca144e91a (diff)
downloadlua-language-server-d7e96432ccd7f736c0f269ccca68cf4b840927db.zip
resolve #747 `LuaDoc` supports unicode
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/luadoc.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index e21e7c19..2682e2d4 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -10,9 +10,8 @@ local Parser = re.compile([[
Main <- (Token / Sp)*
Sp <- %s+
X16 <- [a-fA-F0-9]
-Word <- [a-zA-Z0-9_]
Token <- Integer / Name / String / Symbol
-Name <- ({} {[a-zA-Z_0-9] [a-zA-Z0-9_.*-]*} {})
+Name <- ({} {%name} {})
-> Name
Integer <- ({} {[0-9]+} !'.' {})
-> Integer
@@ -45,7 +44,7 @@ EChar <- 'a' -> ea
/ ('z' (%nl / %s)*) -> ''
/ ('x' {X16 X16}) -> Char16
/ ([0-9] [0-9]? [0-9]?) -> Char10
- / ('u{' {Word*} '}') -> CharUtf8
+ / ('u{' {X16*} '}') -> CharUtf8
Symbol <- ({} {
[:|,<>()?+#`{}]
/ '[]'
@@ -63,6 +62,7 @@ Symbol <- ({} {
er = '\r',
et = '\t',
ev = '\v',
+ name = (m.R('az', 'AZ', '09', '\x80\xff') + m.S('_')) * (m.R('az', 'AZ', '__', '09', '\x80\xff') + m.S('_.*-'))^0,
Char10 = function (char)
char = tonumber(char)
if not char or char < 0 or char > 255 then