1
0
mirror of https://github.com/KarolS/millfork.git synced 2025-01-11 12:29:46 +00:00

8080: better compiler error messages

This commit is contained in:
Karol Stasiak 2019-01-11 15:17:01 +01:00
parent f71b6a0b04
commit 8211b3cf49

View File

@ -80,7 +80,10 @@ object Z80StatementCompiler extends AbstractStatementCompiler[ZLine] {
case Assignment(destination, source) =>
val sourceType = AbstractExpressionCompiler.getExpressionType(ctx, source)
(sourceType.size match {
case 0 => ???
case 0 =>
ctx.log.error("Cannot assign a void expression", statement.position)
Z80ExpressionCompiler.compile(ctx, source, ZExpressionTarget.NOTHING, BranchSpec.None) ++
Z80ExpressionCompiler.compile(ctx, destination, ZExpressionTarget.NOTHING, BranchSpec.None)
case 1 => Z80ExpressionCompiler.compileToA(ctx, source) ++ Z80ExpressionCompiler.storeA(ctx, destination, sourceType.isSigned)
case 2 => Z80ExpressionCompiler.compileToHL(ctx, source) ++ Z80ExpressionCompiler.storeHL(ctx, destination, sourceType.isSigned)
case s => Z80ExpressionCompiler.storeLarge(ctx, destination, source)