blockVar method

Parser<List<VariableDeclarationNode>> blockVar()

Implementation

Parser<List<VariableDeclarationNode>> blockVar() => seq2(
  ref1(token, 'var'),
  seq4(
        ref0(identifier)
            .plusSeparated(ref1(token, ','))
            .map((sep) => sep.elements),
        ref1(token, ':'),
        ref0(type),
        ref1(token, ';'),
      )
      .map4(
        (names, _, type, _) =>
            VariableDeclarationNode(names: names, type: type),
      )
      .plus(),
).map2((_, vars) => vars);