memberAccess method

Parser<Expression> memberAccess()

Implementation

Parser<Expression> memberAccess() =>
    (char('.') & partialIdentifier().optional())
        .mapWithPosition((list, start, end) {
      final id = list[1]; // partialIdentifier result
      if (id != null) {
        return id;
      } else {
        // For dangling dot, create empty identifier starting after the dot
        // The end position will be fixed by the parent variable() parser
        return Identifier('')..start = end..end = end;
      }
    });