From d86588aceb0d8e8e6ecf075689887b581ffc42c1 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Fri, 21 Apr 2017 17:20:36 -0700 Subject: [PATCH] Use `$()` to return matched string instead of `head:* tail:*` (#477) --- blocks/api/post.pegjs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/blocks/api/post.pegjs b/blocks/api/post.pegjs index c8c370731bdf83..886137c830cf8e 100644 --- a/blocks/api/post.pegjs +++ b/blocks/api/post.pegjs @@ -39,8 +39,7 @@ WP_Block_End } } WP_Block_Type - = head:ASCII_Letter tail:WP_Block_Type_Char* - { return [ head ].concat( tail ).join( '' ) } + = $(ASCII_Letter WP_Block_Type_Char*) WP_Block_Attribute_List = as:(_+ attr:WP_Block_Attribute { return attr })* @@ -54,12 +53,10 @@ WP_Block_Attribute { return { name: name, value: value }; } WP_Block_Attribute_Name - = head:ASCII_Letter tail:ASCII_AlphaNumeric* - { return [ head ].concat( tail ).join( '' ) } + = $(ASCII_Letter ASCII_AlphaNumeric*) WP_Block_Attribute_Value - = head:ASCII_Letter tail:WP_Block_Attribute_Value_Char* - { return [ head ].concat( tail ).join( '' ) } + = $(ASCII_Letter WP_Block_Attribute_Value_Char*) WP_Block_Type_Char = ASCII_AlphaNumeric