From 3d7cb724b13e75a7e4dab9b6bcf24e1f1f1de2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 28 Jun 2019 10:14:03 +0800 Subject: =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E8=A1=8C=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/parser/ast.lua | 2 +- server/src/parser/grammar.lua | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'server/src') diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua index e2add23e..f9a6d53d 100644 --- a/server/src/parser/ast.lua +++ b/server/src/parser/ast.lua @@ -1316,7 +1316,7 @@ local Defs = { EmmyComment = function (...) return { type = 'emmyComment', - [1] = table.concat({...}, ' '), + [1] = table.concat({...}), } end, EmmyOption = function (options) diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua index 5a408d90..c53597dd 100644 --- a/server/src/parser/grammar.lua +++ b/server/src/parser/grammar.lua @@ -517,9 +517,11 @@ grammar 'Emmy' [[ Emmy <- EmmySp '---@' EmmyBody ShortComment / EmmyComments EmmySp <- (!'---@' !'---' Comment / %s / %nl)* -EmmyComments <- (EmmyComment (%nl EmmyComment)*) +EmmyComments <- (EmmyComment (%nl EmmyComMulti / %nl EmmyComSingle)*) -> EmmyComment -EmmyComment <- EmmySp '---' !'@' %s* {(!%nl .)*} +EmmyComment <- EmmySp '---' !'@' %s* {(!%nl .)*} +EmmyComMulti <- EmmySp '---|' {} -> en {(!%nl .)*} +EmmyComSingle <- EmmySp '---' !'@' %s* {} -> ' ' {(!%nl .)*} EmmyBody <- 'class' %s+ EmmyClass -> EmmyClass / 'type' %s+ EmmyType -> EmmyType / 'alias' %s+ EmmyAlias -> EmmyAlias -- cgit v1.2.3