asKeywords method

Parser asKeywords(
  1. List<String> list
)

Given a list of possible keywords, return a rule that accepts any of them. e.g., given "male", "female", "other", accept any of them.

Implementation

Parser asKeywords(List<String> list) =>
    list.map(string).cast<Parser>().reduce((a, b) => a | b).flatten().trim();