diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-10-22 13:34:32 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-10-22 13:34:32 +0800 |
commit | 596b446b682a21f3d28adaee304de66dd9a3155c (patch) | |
tree | 3af076e70796d0e586d1e02aff5bf07787f6fc71 | |
parent | b622ee7be1f09100f7ce0e8098acd2257a42e702 (diff) | |
download | lua-language-server-596b446b682a21f3d28adaee304de66dd9a3155c.zip |
close #74 去掉 ---| ,使用 --- 代替
-rw-r--r-- | server/src/parser/ast.lua | 2 | ||||
-rw-r--r-- | server/src/parser/grammar.lua | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua index 92d14eb6..0eb17a80 100644 --- a/server/src/parser/ast.lua +++ b/server/src/parser/ast.lua @@ -1467,7 +1467,7 @@ local Defs = { EmmyComment = function (...) return { type = 'emmyComment', - [1] = table.concat({...}), + [1] = table.concat({...}, '\n'), } end, EmmyOption = function (options) diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua index 6a98284d..636e08b0 100644 --- a/server/src/parser/grammar.lua +++ b/server/src/parser/grammar.lua @@ -518,11 +518,9 @@ grammar 'Emmy' [[ Emmy <- EmmySp '---@' EmmyBody ShortComment / EmmyComments EmmySp <- (!'---@' !'---' Comment / %s / %nl)* -EmmyComments <- (EmmyComment (%nl EmmyComMulti / %nl EmmyComSingle)*) +EmmyComments <- EmmyComment+ -> EmmyComment -EmmyComment <- EmmySp '---' !'@' %s* {(!%nl .)*} -EmmyComMulti <- EmmySp '---|' {} -> en {(!%nl .)*} -EmmyComSingle <- EmmySp '---' !'@' %s* {} -> ' ' {(!%nl .)*} +EmmyComment <- EmmySp '---' !'@' %s* {(!%nl .)*} EmmyBody <- 'class' %s+ EmmyClass -> EmmyClass / 'type' %s+ EmmyType -> EmmyType / 'alias' %s+ EmmyAlias -> EmmyAlias |