code: function buildExpectedDescription(expected) {
      var descriptions = _.pluck(expected, 'description');
  
      return descriptions.length > 1
          ? descriptions.slice(0, -1).join(', ')
                + ' or '
                + descriptions[expected.length - 1]
          : descriptions[0];
  }
docs: The following functions are adapted from PEG.js because it currently doesn't expose this functionality (and I'm not 100% sure exposing it is a good idea). This is the exact code taken as a base:  https://github.com/pegjs/pegjs/blob/eaca5f0acf97b66ef141fed84aa95d4e72e33757/lib/compiler/passes/generate-javascript.js#L1075-L1119