parsley.internal.deepembedding.singletons.ErrorEmbedding.scala Maven / Gradle / Ivy
/* SPDX-FileCopyrightText: © 2022 Parsley Contributors
* SPDX-License-Identifier: BSD-3-Clause
*/
package parsley.internal.deepembedding.singletons
import parsley.internal.deepembedding.backend.MZero
import parsley.internal.machine.instructions
private [parsley] final class Fail(width: Int, msgs: String*) extends Singleton[Nothing] with MZero {
// $COVERAGE-OFF$
override def pretty: String = s"fail(${msgs.mkString(", ")})"
// $COVERAGE-ON$
override def instr: instructions.Instr = new instructions.Fail(width: Int, msgs: _*)
}
private [parsley] final class Unexpected(msg: String, width: Int) extends Singleton[Nothing] with MZero {
// $COVERAGE-OFF$
override def pretty: String = s"unexpected($msg)"
// $COVERAGE-ON$
override def instr: instructions.Instr = new instructions.Unexpected(msg, width)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy