reportNonstrict method

void reportNonstrict(
  1. String errorCode,
  2. String errorMsg, [
  3. Token? token
])

Implementation

void reportNonstrict(String errorCode, String errorMsg, [Token? token]) {
  final strict = this.strict != Strict.function
      ? this.strict
      : (strictFun?.call(errorCode, errorMsg, token) ?? Strict.warn);
  switch (strict) {
    case Strict.ignore:
      return;
    case Strict.error:
      throw ParseException(
          "LaTeX-incompatible input and strict mode is set to 'error': "
          '$errorMsg [$errorCode]',
          token);
    case Strict.warn:
      warn("LaTeX-incompatible input and strict mode is set to 'warn': "
          '$errorMsg [$errorCode]');
      break;
    default:
      warn('LaTeX-incompatible input and strict mode is set to '
          "unrecognized '$strict': $errorMsg [$errorCode]");
  }
}