trySetByteRange method

bool trySetByteRange(
  1. int startByte,
  2. int endByte
)

Native boolean-returning counterpart of ts_query_cursor_set_byte_range.

Implementation

bool trySetByteRange(int startByte, int endByte) {
  _checkNotDisposed();
  if (startByte < 0 || endByte < 0 || endByte != 0 && endByte < startByte) {
    return false;
  }
  _range = _TreeSitterQueryRange.bytes(startByte, endByte);
  return true;
}