summaryrefslogtreecommitdiff
path: root/server/src/parser/grammar.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-28 16:10:14 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-28 16:10:14 +0800
commit13a9025d969bc416cd4c1057865448812f00e00b (patch)
tree3e13cea336e510d183c817b6a7af89ae2228c882 /server/src/parser/grammar.lua
parentd544fa45c903bbc479ae383e3626940316134ba1 (diff)
downloadlua-language-server-13a9025d969bc416cd4c1057865448812f00e00b.zip
#101 --- 和 @ 之间可以有空格
Diffstat (limited to 'server/src/parser/grammar.lua')
-rw-r--r--server/src/parser/grammar.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua
index 636e08b0..5aa5d14c 100644
--- a/server/src/parser/grammar.lua
+++ b/server/src/parser/grammar.lua
@@ -515,12 +515,14 @@ Emmy <- '---@'
]]
grammar 'Emmy' [[
-Emmy <- EmmySp '---@' EmmyBody ShortComment
- / EmmyComments
-EmmySp <- (!'---@' !'---' Comment / %s / %nl)*
+Emmy <- EmmySp '---' %s*
+ ( '@' EmmyBody ShortComment
+ / EmmyComments
+ )
+EmmySp <- (!'---' Comment / %s / %nl)*
EmmyComments <- EmmyComment+
-> EmmyComment
-EmmyComment <- EmmySp '---' !'@' %s* {(!%nl .)*}
+EmmyComment <- {(!%nl .)+}
EmmyBody <- 'class' %s+ EmmyClass -> EmmyClass
/ 'type' %s+ EmmyType -> EmmyType
/ 'alias' %s+ EmmyAlias -> EmmyAlias