1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-06-12 06:29:34 +00:00

Fix warning messages

This commit is contained in:
Karol Stasiak 2020-09-09 01:45:53 +02:00
parent ae311f28ea
commit 75c8ac19e1

View File

@ -133,18 +133,18 @@ case class MosParser(filename: String, input: String, currentDirectory: String,
def validateAsmFunctionBody(p: Position, flags: Set[String], name: String, statements: Option[List[Statement]]): Unit = {
if (!options.flag(CompilationFlag.BuggyCodeWarning)) return
statements match {
case Some(Nil) => log.warn("Assembly function `$name` is empty, did you mean RTS, RTI or JMP", Some(p))
case Some(Nil) => log.warn(s"Assembly function `$name` is empty, did you mean RTS, RTI or JMP", Some(p))
case Some(xs) =>
if (flags("interrupt")) {
if (xs.exists {
case MosAssemblyStatement(Opcode.RTS, _, _, _) => true
case _ => false
}) log.warn("Assembly interrupt function `$name` contains RTS, did you mean RTI?", Some(p))
}) log.warn(s"Assembly interrupt function `$name` contains RTS, did you mean RTI?", Some(p))
} else {
if (xs.exists {
case MosAssemblyStatement(Opcode.RTI, _, _, _) => true
case _ => false
}) log.warn("Assembly non-interrupt function `$name` contains RTI, did you mean RTS?", Some(p))
}) log.warn(s"Assembly non-interrupt function `$name` contains RTI, did you mean RTS?", Some(p))
}
if (!name.startsWith("__") && !flags("macro")) {
xs.last match {