fail method

void fail(
  1. int pos,
  2. int kind, [
  3. Object? value,
  4. int start = -1,
  5. int end = -1,
])

Implementation

@pragma('vm:prefer-inline')
void fail(int pos, int kind, [Object? value, int start = -1, int end = -1]) {
  ok = false;
  if (log) {
    if (errorPos <= pos && minErrorPos <= pos) {
      if (errorPos < pos) {
        errorPos = pos;
        _length = 0;
      }

      _ends[_length] = end;
      _kinds[_length] = kind;
      _starts[_length] = start;
      _values[_length] = value;
      _length++;
    }

    if (lastErrorPos < pos) {
      lastErrorPos = pos;
    }
  }
}