addRule method

void addRule(
  1. String key,
  2. Matcher rule
)

Adds a rule.

Implementation

void addRule(String key, Matcher rule) {
  if (!rules.containsKey(key)) {
    rules[key] = [rule];
    return;
  }

  rules[key].add(rule);
}