Skip to content

Add offset and end to NodeList #60261

Closed
Closed
@FMorschel

Description

@FMorschel

Over at https://dart-review.googlesource.com/c/sdk/+/413520/comment/107d6345_854a2009/, @bwilkerson suggested:

We should maybe consider adding NodeList.offset, NodeList.length, and NodeList.end
You can use combinators.beginToken?.offset and combinators.endToken?.end to get this information.

At that CL, I made an extension for those values. Two things to have in mind here:

  • The list can be empty so offset and end should be nullable
  • There is already a length getter which means how many items we have inside the list. We should probably think of a better name for this length or not implement it since it can be easily calculated with the other two values. At the CL extension, I've named it nodesLength.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions