From 04fef592927d16fe520584f62dd5a23e8f6f8970 Mon Sep 17 00:00:00 2001 From: Jamie Willis Date: Sun, 21 May 2023 13:56:29 +0100 Subject: [PATCH] Removed redundant double update for Unexpected errors --- .../scala/parsley/internal/machine/errors/DefuncError.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parsley/shared/src/main/scala/parsley/internal/machine/errors/DefuncError.scala b/parsley/shared/src/main/scala/parsley/internal/machine/errors/DefuncError.scala index ce8c7126c..c22f0ef10 100644 --- a/parsley/shared/src/main/scala/parsley/internal/machine/errors/DefuncError.scala +++ b/parsley/shared/src/main/scala/parsley/internal/machine/errors/DefuncError.scala @@ -287,7 +287,8 @@ private [parsley] final class ClassicUnexpectedError(val offset: Int, val line: override final val flags = if (expected.isEmpty) (DefuncError.ExpectedEmptyMask | DefuncError.TrivialErrorMask).toByte else DefuncError.TrivialErrorMask override def expectedIterable: Iterable[ExpectItem] = expected override private [errors] def unexpectedWidth: Int = unexpected.width - override def addLabelsAndReasons(builder: TrivialErrorBuilder): Unit = { + override def makeTrivial(builder: TrivialErrorBuilder): Unit = { + builder.pos_=(line, col) builder += expected builder.updateUnexpected(unexpected) }