internal ParserException(Builder.Localization.ErrorMessages errorType, Token token, Builder.Localization.Locale locale) : this(token, locale.Strings.Get(errorType.ToString())) { this.TokenInfo = token; this.OriginalMessage = locale.Strings.Get(errorType.ToString()); }
// Throws an exception, but also returns an exception so that you can use 'throw' syntax // at the calling site to prevent the compiler from complaining about control flow branches // that aren't actually accessible. internal static ParserException ThrowException(Builder.Localization.Locale locale, Builder.Localization.ErrorMessages errorType, Token token, params string[] args) { throw new ParserException(token, locale.Strings.Get(errorType.ToString(), args)); }