failAt<R> method

Result<R>? failAt<R>(
  1. int offset,
  2. ParseError error
)

Implementation

@pragma('vm:prefer-inline')
Result<R>? failAt<R>(int offset, ParseError error) {
  if (offset >= failPos) {
    if (failPos < offset) {
      failPos = offset;
      errorCount = 0;
    }
    if (errorCount < errors.length) {
      errors[errorCount++] = error;
    }
  }

  return null;
}