summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-22 13:34:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-22 13:34:32 +0800
commit596b446b682a21f3d28adaee304de66dd9a3155c (patch)
tree3af076e70796d0e586d1e02aff5bf07787f6fc71
parentb622ee7be1f09100f7ce0e8098acd2257a42e702 (diff)
downloadlua-language-server-596b446b682a21f3d28adaee304de66dd9a3155c.zip
close #74 去掉 ---| ,使用 --- 代替
-rw-r--r--server/src/parser/ast.lua2
-rw-r--r--server/src/parser/grammar.lua6
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