From c5189d8f5282f6db1dc7e0f91b9cbca6f4dc4863 Mon Sep 17 00:00:00 2001 From: marihachi Date: Sun, 18 Apr 2021 14:13:23 +0900 Subject: [PATCH] Parser: improve performance --- src/parser.pegjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parser.pegjs b/src/parser.pegjs index 3ac878d..93b53c8 100644 --- a/src/parser.pegjs +++ b/src/parser.pegjs @@ -121,7 +121,10 @@ inline // block: quote quote - = &(BEGIN ">") head:quoteMultiLine tails:quoteMultiLine+ + = &(BEGIN ">") q:quoteInner { return q; } + +quoteInner + = head:quoteMultiLine tails:quoteMultiLine+ { const children = applyParser([head, ...tails].join('\n'), 'fullParser'); return QUOTE(children);