Skip to content

Commit

Permalink
Use $() to return matched string instead of head:* tail:* (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell authored Apr 22, 2017
1 parent f75cdde commit d86588a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions blocks/api/post.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 })*
Expand All @@ -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
Expand Down

0 comments on commit d86588a

Please sign in to comment.