NodeLocator2 constructor

NodeLocator2(
  1. int startOffset,
  2. [int endOffset]
)

Initialize a newly created locator to locate the deepest AstNode for which node.offset <= [startOffset] and [endOffset] < node.end.

If endOffset is not provided, then it is considered the same as the given startOffset.

Implementation

NodeLocator2(int startOffset, [int endOffset])
    : this._startOffset = startOffset,
      this._endOffset = endOffset ?? startOffset;