def token_map
      @token_map ||= Hash[tags.map { |type, tags| [tags[0], [type, tags[0].count(?{), tags[1].length]] }]
    end
def token_map
      @token_map ||= Hash[tags.map { |type, tags| [tags[0], [type, tags[0].count(?{), tags[1].length]] }]
    end
map the set of tags into a hash used by the parse routine that converts an opening tag into a
 list of: tag type, the number of opening braces in the tag and the length of the closing tag