enumBody method

Parser<(List<EnumConstantNode>, List<DeclarationNode>)> enumBody()
inherited

Implementation

Parser<(List<EnumConstantNode>, List<DeclarationNode>)> enumBody() => seq3(
  ref0(enumConstant)
      .plusSeparated(ref1(token, ','))
      .map((l) => l.elements)
      .optionalWith(const <EnumConstantNode>[]),
  ref1(token, ',').optional(),
  (ref1(token, ';') & ref0(classMemberDefinition).star())
      .map((l) => l[1] as List<DeclarationNode>)
      .optionalWith(const <DeclarationNode>[]),
).map3((constants, _, members) => (constants, members));