rule method

  1. @override
Parser<Rule> rule()
override

Implementation

@override
Parser<Rule> rule() => super.rule().map((each) {
      scope.clear();
      final head = each[0];
      final rest = each[1];
      if (rest == null) {
        return Rule(head, const Value('true'));
      }
      final List terms = rest[1];
      if (terms.isEmpty) {
        return Rule(head, const Value('true'));
      } else if (terms.length == 1) {
        return Rule(head, terms[0]);
      } else {
        return Rule(head, Conjunction(terms.cast()));
      }
    });