fieldListBase method

Parser<List<VariableDeclarationNode>> fieldListBase()

Implementation

Parser<List<VariableDeclarationNode>> fieldListBase() =>
    seq3(
          ref0(identifier)
              .plusSeparated(ref1(token, ','))
              .map((sep) => sep.elements),
          ref1(token, ':'),
          ref0(type),
        )
        .map3(
          (names, _, type) =>
              VariableDeclarationNode(names: names, type: type),
        )
        .plusSeparated(ref1(token, ';'))
        .skip(after: ref1(token, ';').optional())
        .map((sep) => sep.elements);