fail method

void fail(
  1. int pos,
  2. int kind,
  3. Object? value, {
  4. int length = -1,
  5. int start = -1,
})

Implementation

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

      _kinds[_length] = kind;
      _lengths[_length] = length;
      _starts[_length] = start;
      _values[_length] = value;
      _length++;
    }

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