summaryrefslogtreecommitdiff
path: root/server/src/parser/grammar.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-30 10:55:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-30 10:55:10 +0800
commit624c1ddbffafef38b797f181fbcca000b293b60b (patch)
treec5d430d1c289fc23c635c99e5b99afe56f31b00e /server/src/parser/grammar.lua
parent5c7f8776c839bc6898953affb0d94ec99e435cd8 (diff)
downloadlua-language-server-624c1ddbffafef38b797f181fbcca000b293b60b.zip
修正多行Emmy注释的bug
Diffstat (limited to 'server/src/parser/grammar.lua')
-rw-r--r--server/src/parser/grammar.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua
index 5aa5d14c..3525677a 100644
--- a/server/src/parser/grammar.lua
+++ b/server/src/parser/grammar.lua
@@ -515,14 +515,13 @@ Emmy <- '---@'
]]
grammar 'Emmy' [[
-Emmy <- EmmySp '---' %s*
- ( '@' EmmyBody ShortComment
- / EmmyComments
- )
+Emmy <- EmmyAction
+ / EmmyComments
+EmmyAction <- EmmySp '---' %s* '@' EmmyBody ShortComment
EmmySp <- (!'---' Comment / %s / %nl)*
EmmyComments <- EmmyComment+
-> EmmyComment
-EmmyComment <- {(!%nl .)+}
+EmmyComment <- EmmySp '---' %s* !'@' {(!%nl .)*}
EmmyBody <- 'class' %s+ EmmyClass -> EmmyClass
/ 'type' %s+ EmmyType -> EmmyType
/ 'alias' %s+ EmmyAlias -> EmmyAlias