diff --git a/parsley/shared/src/main/scala/parsley/token/Lexer.scala b/parsley/shared/src/main/scala/parsley/token/Lexer.scala index 7e0b6d083..17c24dc84 100644 --- a/parsley/shared/src/main/scala/parsley/token/Lexer.scala +++ b/parsley/shared/src/main/scala/parsley/token/Lexer.scala @@ -234,8 +234,6 @@ class Lexer(desc: descriptions.LexicalDesc, errConfig: errors.ErrorConfig) { */ def this(desc: descriptions.LexicalDesc) = this(desc, errors.ErrorConfig.default) - if (!errConfig.pleaseDontValidateConfig) errConfig.validateConfig() - private val generic = new numeric.Generic(errConfig) /** This object is concerned with ''lexemes'': these are tokens that are diff --git a/parsley/shared/src/main/scala/parsley/token/errors/ErrorConfig.scala b/parsley/shared/src/main/scala/parsley/token/errors/ErrorConfig.scala index e7b49dca5..841c117fe 100644 --- a/parsley/shared/src/main/scala/parsley/token/errors/ErrorConfig.scala +++ b/parsley/shared/src/main/scala/parsley/token/errors/ErrorConfig.scala @@ -14,39 +14,6 @@ import parsley.position */ // TODO: We could make these groupings into merged ADTs? Must be careful with binary-lock-in though... class ErrorConfig { - // Right, I give up. Some of the interactions between these configurations are absurd, so I need - // to guard against stuff that's just plain odd: - def pleaseDontValidateConfig = false - private [token] final def validateConfig(): Unit = { - val bits = List(8, 16, 32, 64) - def badEnd(ty: String) = s"cannot specify the end of a $ty integer literal without specifying the start or unsigned and signed $ty literals" - require(labelIntegerBinaryEnd.isEmpty || - (labelIntegerSignedBinary :: - labelIntegerUnsignedBinary :: - bits.map(labelIntegerSignedBinary) ::: - bits.map(labelIntegerUnsignedBinary)).forall(_.nonEmpty), badEnd("binary")) - require(labelIntegerDecimalEnd.isEmpty || - (labelIntegerSignedDecimal :: - labelIntegerUnsignedDecimal :: - bits.map(labelIntegerSignedDecimal) ::: - bits.map(labelIntegerUnsignedDecimal)).forall(_.nonEmpty), badEnd("decimal")) - require(labelIntegerHexadecimalEnd.isEmpty || - (labelIntegerSignedHexadecimal :: - labelIntegerUnsignedHexadecimal :: - bits.map(labelIntegerSignedHexadecimal) ::: - bits.map(labelIntegerUnsignedHexadecimal)).forall(_.nonEmpty), badEnd("hexadecimal")) - require(labelIntegerOctalEnd.isEmpty || - (labelIntegerSignedOctal :: - labelIntegerUnsignedOctal :: - bits.map(labelIntegerSignedOctal) ::: - bits.map(labelIntegerUnsignedOctal)).forall(_.nonEmpty), badEnd("octal")) - require(labelIntegerNumberEnd.isEmpty || - (labelIntegerSignedNumber :: - labelIntegerUnsignedNumber :: - bits.map(labelIntegerSignedNumber) ::: - bits.map(labelIntegerUnsignedNumber)).forall(_.nonEmpty), badEnd("number")) - } - // numeric def labelNumericBreakChar: Option[String] = None diff --git a/parsley/shared/src/main/scala/parsley/token/numeric/UnsignedReal.scala b/parsley/shared/src/main/scala/parsley/token/numeric/UnsignedReal.scala index da3e318f2..416f2f997 100644 --- a/parsley/shared/src/main/scala/parsley/token/numeric/UnsignedReal.scala +++ b/parsley/shared/src/main/scala/parsley/token/numeric/UnsignedReal.scala @@ -96,7 +96,6 @@ private [token] final class UnsignedReal(desc: NumericDesc, natural: UnsignedInt val (requiredExponent, exponent, base) = expDesc match { case ExponentDesc.Supported(compulsory, exp, base, sign) => val expErr = new ErrorConfig { - override def pleaseDontValidateConfig: Boolean = true override def labelIntegerSignedDecimal(bits: Int): Option[String] = err.labelRealExponentEnd.orElse(endLabel) override def labelIntegerDecimalEnd: Option[String] = err.labelRealExponentEnd.orElse(endLabel) }