From 596b446b682a21f3d28adaee304de66dd9a3155c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 22 Oct 2019 13:34:32 +0800 Subject: =?UTF-8?q?close=20#74=20=E5=8E=BB=E6=8E=89=20---|=20=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20---=20=E4=BB=A3=E6=9B=BF?= 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, 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 -- cgit v1.2.3